Skip to content

chore: New manual GitHub Action to diff bundled outputs #2489

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

Draft
wants to merge 5 commits into
base: master
Choose a base branch
from

Conversation

jdeichert
Copy link
Contributor

@jdeichert jdeichert commented Apr 16, 2025

Motivations

This PR adds a new manually-triggered GitHub Action that diffs the outputs of our packages on a given branch.

If you're testing a PR... let's say a dependabot version bump of some dependency... and you're not sure whether it's safe to ship because it could affect the final built assets that we ship, THIS ACTION IS FOR YOU!

Simply run this GH Action against your branch and you'll see one of two things:

✅ No differences found in built assets!

OR

⚠️ Differences found in built assets! This indicates that the compiled outputs in this branch don't match what master produces."
👉 Please investigate the differences above to see if they are expected.

If you see the latter warning, look above it and you'll see a git diff showing what exactly changed. Usually it will be something within a dist directory in one of the packages. Just review the diff to see if it makes sense and whether it's safe to ship OR if you need to do more testing, then do that!

Changes

Added

  • New GitHub Action to diff bundle/package outputs

Testing

No need to test, I ran this on this PR a few times.

When there's no changes

https://github.com/GetJobber/atlantis/actions/runs/14503388190

Screenshot 2025-04-16 at 3 12 30 PM

When there are changes

https://github.com/GetJobber/atlantis/actions/runs/14503583543/job/40688621884

Screenshot 2025-04-16 at 3 15 59 PM

Changes can be tested via Pre-release

Copy link

cloudflare-workers-and-pages bot commented Apr 16, 2025

Deploying atlantis with  Cloudflare Pages  Cloudflare Pages

Latest commit: 530a38f
Status: ✅  Deploy successful!
Preview URL: https://7aa866f3.atlantis.pages.dev
Branch Preview URL: https://cleanup-git-diff-action.atlantis.pages.dev

View logs

@jdeichert jdeichert force-pushed the CLEANUP/git-diff-action branch from 51060f2 to be99164 Compare April 16, 2025 22:11
@jdeichert jdeichert changed the title chore: Git diff action chore: New manual GitHub Action to diff bundled outputs Apr 16, 2025
@@ -0,0 +1,69 @@
name: Diff Outputs

on: workflow_dispatch
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This is a manual action because we don't need to run it on every PR. It'll show up here after this merges: https://github.com/GetJobber/atlantis/actions

@jdeichert jdeichert marked this pull request as ready for review April 16, 2025 22:20
@jdeichert jdeichert requested a review from a team as a code owner April 16, 2025 22:20
@Aiden-Brine Aiden-Brine self-requested a review April 16, 2025 23:39

# Unignore dist directories and stage them to commit later
sed -i '/\<dist\>/d' .gitignore
git add -A
Copy link
Contributor

Choose a reason for hiding this comment

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

I think we should force add them with -f instead of modifying the .gitignore file

git config --global user.email "[email protected]"

- name: Check for differences in built assets
run: |
Copy link
Contributor

Choose a reason for hiding this comment

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

How about having set -e at the top of the script so that if something like npm ci fails it will exit out quickly?


- name: Check for differences in built assets
run: |
clean_dist() {
Copy link
Contributor

Choose a reason for hiding this comment

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

I'm also wondering if it would be more readable if this was broken up into more name/run commands? You have lots of echo statements so it is still fairly easy to follow and I feel less strongly about this one.

@jdeichert jdeichert marked this pull request as draft May 22, 2025 22:19
@jdeichert jdeichert requested a review from a team May 22, 2025 22:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

Successfully merging this pull request may close these issues.

2 participants