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

chore(repo): skip hangar when not needed #3791

Merged
merged 67 commits into from
Aug 30, 2023
Merged

chore(repo): skip hangar when not needed #3791

merged 67 commits into from
Aug 30, 2023

Conversation

MarkMcCulloh
Copy link
Contributor

@MarkMcCulloh MarkMcCulloh commented Aug 11, 2023

Goal

Skip e2e tests when the changes in the PR don't effect it. Notably, this usually means unit tests, README, or anything in the console.

"changes" here means one of 2 things:

  • If non-pr: Last successful build workflow on the same branch
  • If pr: git diff of the PR compared to the base, ignoring any commits from upstream

This high-level logic is the same that we've been using to determine whether or not we deploy the vscode extension, so this extends it to the e2e and benchmarking tests as well.
Unfortunately turbo itself was not sufficient for this goal (see note at the top of tools/bump-pack/src/turbo-diff.ts), so I had to write some junk to properly determine "what changed". I swear I've had to write something like this like 9 times already at various points in my life.

Limitations

The "Last successful build workflow on the same branch" does not apply to PRs, even though I wish it did. Implementing this safely is more difficult than it seems.

The future of bump-pack

Part of the this PR is also effectively turning "bump-pack" into a general-purpose toolkit. In a followup PR I plan to simply turn the entire package into a full CLI to serve misc repo development purposes. My hope is that this will make it easier to actually add testing to it with a fixture based on https://github.com/kiegroup/mock-github and https://github.com/kiegroup/act-js

Misc

  • Added a script for the git patching stuff, didn't like so much repetitious bash in the workflow
  • Effectively forked nrwl/nx-set-shas since it was not sufficient for the workflow I wanted here (It always assumed you wanted to compare against main in a PR) Nevermind, it turns out that the original action is actually good enough

By submitting this pull request, I confirm that my contribution is made under the terms of the Wing Cloud Contribution License.

@monadabot monadabot added the ⚠️ pr/review-mutation PR has been mutated and will not auto-merge. Clear this label if the changes look good! label Aug 11, 2023
@MarkMcCulloh MarkMcCulloh removed the ⚠️ pr/review-mutation PR has been mutated and will not auto-merge. Clear this label if the changes look good! label Aug 18, 2023
@monadabot monadabot added the ⚠️ pr/review-mutation PR has been mutated and will not auto-merge. Clear this label if the changes look good! label Aug 21, 2023
@monadabot
Copy link
Contributor

Console preview environment is available at https://wing-console-pr-3791.fly.dev 🚀

Updated (UTC): 2023-08-30 14:18

@mergify
Copy link
Contributor

mergify bot commented Aug 30, 2023

Thanks for contributing, @MarkMcCulloh! This PR will now be added to the merge queue, or immediately merged if mark/improving-dx is up-to-date with main and the queue is empty.

@mergify mergify bot merged commit bfbd81d into main Aug 30, 2023
12 checks passed
@mergify mergify bot deleted the mark/improving-dx branch August 30, 2023 14:30
@monadabot
Copy link
Contributor

Congrats! 🚀 This was released in Wing 0.27.3.

mergify bot pushed a commit that referenced this pull request Aug 30, 2023
A regression from #3791

*By submitting this pull request, I confirm that my contribution is made under the terms of the [Wing Cloud Contribution License](https://github.com/winglang/wing/blob/main/CONTRIBUTION_LICENSE.md)*.
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.

3 participants