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

Prevent CI from masking version problem bugs #143

Closed

Conversation

oflatt
Copy link
Contributor

@oflatt oflatt commented Jun 4, 2024

The current CI hides version problems by overwriting the version of Cedar used.
This PR removes that functionality.

@oflatt oflatt changed the base branch from release/3.2.x to main June 4, 2024 00:02
# If we passed a branch for cedar-policy, modify Cargo.toml to use that branch
- name: Replace Crates dot IO with Github version
if: "${{ inputs.cedar_policy_ref != '' }}"
run: cd cedar-rust-hello-world && printf "\n[patch.crates-io]\ncedar-policy = { git = 'https://github.com/cedar-policy/cedar.git', rev = '${{ inputs.cedar_policy_ref }}'}" >> Cargo.toml
Copy link
Contributor

@john-h-kastner-aws john-h-kastner-aws Jun 4, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I agree that we should fix CI to detect a mistake in versioning, but I think this code is necessary.
The intent of this step is that we should be able to submit a PR to cedar-policy and then check that cedar-examples builds and passes tests with the changes in the PR branch, so just building against the crates.io release won't work.

Maybe try removing

cedar_policy_ref: refs/heads/${{ needs.get-branch-name.outputs.branch_name }}

cedar_policy_ref: refs/heads/${{ needs.get-branch-name.outputs.branch_name }}

and

cedar_policy_ref: refs/heads/${{ needs.get-branch-name.outputs.branch_name }}

instead.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I thought the convention is to use git as the source in cargo.toml files. So this replacement is unnecessary.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

But it needs to point to the correct git branch for a PR, not just the git main or release branch

Copy link
Contributor

@andrewmwells-amazon andrewmwells-amazon Jun 6, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We don't want to do this.
The *reusable.yml tasks take in two branch names, one for cedar-policy and one for cedar-examples. We want this so a change to cedar-policy:releases/3.2.x can build against the 3.2 branch in cedar-examples.
For changes to cedar-examples, the ci.yaml file can point to the correct cedar_policy_ref.

Copy link
Contributor

@andrewmwells-amazon andrewmwells-amazon left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We don't want to do this.

@andrewmwells-amazon
Copy link
Contributor

Let's use #149

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.

4 participants