Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Close #18: Switch policy lang support to V2. #98

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

apetkov-so
Copy link
Contributor

Policy language version 1 is now deprecated, and the parser will error out if it encounters it. Going forward, use policy-version: 2 in the front matter of policy .md files.

@gknopf-aranya
Copy link
Contributor

What will the error look like if someone tries to use policy-version: 1 in a policy file?
Want to make sure it's easy for a user to tell if they are using an old policy version and what the solution would be.
Will we be providing a guide for how to upgrade policy version 1 files to policy version 2? Or do we expect users that are trying to use an older policy file with a new policy VM to downgrade the VM?

smckeon-so
smckeon-so previously approved these changes Feb 13, 2025
@chip-so
Copy link
Contributor

chip-so commented Feb 13, 2025

Will we be providing a guide for how to upgrade policy version 1 files to policy version 2?

Didn't have that planned but that's a good idea.

Or do we expect users that are trying to use an older policy file with a new policy VM to downgrade the VM?

I suppose that would be the only option, as we don't plan to support multiple policy lang versions. But using an older VM will probably mean using an older everything else as some of the internal interfaces are evolving as well.

@chip-so
Copy link
Contributor

chip-so commented Feb 13, 2025

Do people have opinions on how we want to manage the version change? I wasn't planning on landing all the v2 features at once, so there will be some awkward middle ground as it gets built. My thought was I'd throw up the flag early so the version has to be updated now as features roll out. We could also do it at the end. Policies are going to break either way once block scoping is fully enabled.

If we really want it to drop all at once, we could target a feature branch. But I'd rather avoid the PR management hassle if I can.

@elagergren-spideroak
Copy link
Member

Do people have opinions on how we want to manage the version change? I wasn't planning on landing all the v2 features at once, so there will be some awkward middle ground as it gets built. My thought was I'd throw up the flag early so the version has to be updated now as features roll out. We could also do it at the end. Policies are going to break either way once block scoping is fully enabled.

If we really want it to drop all at once, we could target a feature branch. But I'd rather avoid the PR management hassle if I can.

we're the primary user of policy right now, so the "rip the bandaid off" approach is probably just fine

@jdygert-spok
Copy link
Contributor

jdygert-spok commented Feb 13, 2025

I guess I'm not sure of the reason to do the version change now if we are going to do breaking changes later within in this version. Well, I guess there's not much difference in breaking v1 or v2...

@chip-so
Copy link
Contributor

chip-so commented Feb 13, 2025

I guess I'm not sure of the reason to do the version change now if we are going to do breaking changes later within in this version. Well, I guess there's not much difference in breaking v1 or v2...

I figured it was more polite to do this first so people updating aranya-core get an obvious signal rather than a confusing compile error. I don't think it makes much of a difference for people updating continuously, though. They will suffer these changes multiple times regardless.

@apetkov-so
Copy link
Contributor Author

What will the error look like if someone tries to use policy-version: 1 in a policy file? Want to make sure it's easy for a user to tell if they are using an old policy version and what the solution would be. Will we be providing a guide for how to upgrade policy version 1 files to policy version 2? Or do we expect users that are trying to use an older policy file with a new policy VM to downgrade the VM?

Good points. The current error message is Invalid policy version: 1... I will update it to say what the supported version is.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Switch Policy Lang to version 2
6 participants