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

ci: Move AWS CDK check into it's own GHA job #998

Merged
merged 1 commit into from
Dec 23, 2021
Merged

Conversation

akash1810
Copy link
Member

@akash1810 akash1810 commented Dec 23, 2021

What does this change?

Currently CI will fail when the version of AWS CDK libraries being used are over 5 releases out of date. This forces us to keep somewhat up to date with releases, however it does introduce an odd situation:

  1. Raise PR
  2. CI passes on PR
  3. PR gets approved
  4. New AWS CDK released
  5. PR merged
  6. Semantic Release creates a new release
  7. Robot that keeps version in package.json up to date raises PR
  8. Robot PR fails CI and cannot be automatically merged

The latest example of this can be seen on:

Where #977 passed CI (step 2) and was merged (step 5) and #995 (step 7) is now failing it's CI checks (step 8).

When this happens we usually update the branch of the robot's PR to remove the AWS CDK check, allowing CI to pass. This isn't great as we put the check back in the next PR. This is noise.

This change moves the AWS CDK check into a discrete job in GHA. This should mean we can resolve the above solution by updating the branch protection rules, allowing the AWS CDK check to fail but still require the tests to pass.

This yields less noise in the repository.

How to test

CI should pass and there should be another build report.

How can we measure success?

#995 can be merged before #997 and thus the revision history stays truthful.

More importantly though, we able to ignore the AWS CDK check a little more easily.

Have we considered potential risks?

???

Checklist

  • I have listed any breaking changes, along with a migration path 1
  • I have updated the documentation as required for the described changes 2

Footnotes

  1. Consider whether this is something that will mean changes to projects that have already been migrated, or to the CDK CLI tool. If changes are required, consider adding a checklist here and/or linking to related PRs.

  2. If you are adding a new construct or pattern, has new documentation been added? If you are amending defaults or changing behaviour, are the existing docs still valid?

Currently CI will fail when the version of AWS CDK libraries being used are over 5 releases out of date.
This forces us to keep somewhat up to date with releases, however it does introduce an odd situation:
  1. Raise PR
  2. CI passes on PR
  3. PR gets approved
  4. New AWS CDK released
  5. PR merged
  6. Semantic Release creates a new release
  7. Robot that keeps `version` in `package.json` up to date raises PR
  8. Robot PR fails CI and cannot be automatically merged

When this happens we usually update the branch of the robot's PR to remove the AWS CDK check,
allowing CI to pass.
This isn't great as we put the check back in the next PR. This is noise.

This change moves the AWS CDK check into a discrete job in GHA.
This should mean we can resolve the above solution by updating the branch protection rules,
allowing the AWS CDK check to fail but still require the tests to pass.

This yields less noise in the repository.
@akash1810 akash1810 requested a review from a team December 23, 2021 07:59
@akash1810
Copy link
Member Author

akash1810 commented Dec 23, 2021

There's a little dance to do with this PR:

@jacobwinch
Copy link
Contributor

jacobwinch commented Dec 23, 2021

This change moves the AWS CDK check into a discrete job in GHA. This should mean we can resolve the above solution by updating the branch protection rules, allowing the AWS CDK check to fail but still require the tests to pass.

We could also bypass this check automatically for machine users, for example: https://github.com/guardian/cdk/pull/1000/files#diff-944291df2c9c06359d37cc8833d182d705c9e8c3108e7cfe132d61a06e9133ddR22.

@akash1810 akash1810 merged commit 1ea354a into main Dec 23, 2021
@akash1810 akash1810 deleted the aa-check-aws-cdk-step branch December 23, 2021 11:00
@github-actions
Copy link
Contributor

🎉 This PR is included in version 32.0.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

@akash1810
Copy link
Member Author

We could also bypass this check automatically for machine users, for example: https://github.com/guardian/cdk/pull/1000/files#diff-944291df2c9c06359d37cc8833d182d705c9e8c3108e7cfe132d61a06e9133ddR22.

YES! Even more reason to move away from script/ci!

akash1810 added a commit that referenced this pull request Dec 23, 2021
Currently when a new release is made (via Semantic Release), a robot will raise and merge a PR to update `version` in `package.json`.

This is handy as we can browse the file to see what the latest version is.
I don't think it's necessary for the release process - Semantic Release gets the latest version number from npm.

It comes at a slight cost, however:
  - A bit of PR noise. We're not expected to interacted with the robot's PRs, but the `CODEOWNERS` rules mean we get added as reviewers.
  - An odd scenario where our CI checks don't pass and the robot's PR cannot be automatically merged. See #998.

This change moves to a simpler model of keeping `version` in `package.json` completly static between releases.
If one would like to find the number of the latest version, npm or GitHub releases can be used.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants