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

Move dirty tree check to end of every CI job #5140

Closed
mhofman opened this issue Apr 18, 2022 · 5 comments
Closed

Move dirty tree check to end of every CI job #5140

mhofman opened this issue Apr 18, 2022 · 5 comments
Assignees
Labels
enhancement New feature or request tooling repo-wide infrastructure

Comments

@mhofman
Copy link
Member

mhofman commented Apr 18, 2022

What is the Problem Being Solved?

A recent change introduced non-gitignored build output. While arguably that directory pattern should have been ignored in the first place, CI should have prevented a change creating a dirty tree.

We have a check, but it currently only runs after yarn install to make sure the yarn.lock file is not clobbered. We should extend this to anything done to the git tree during a test, including new / untracked files, not just modified files

Description of the Design

Run a dirty tree check at the end of every job as a macro, which also checks for untracked files, and fail the job if the tree is dirty.

We'll likely need to move all integration tests to check out secondary repos not in a sub-folder (or make sure those are ignored)

@mhofman mhofman added enhancement New feature or request tooling repo-wide infrastructure Epic and removed Epic labels Apr 18, 2022
@Tartuffo Tartuffo added tooling repo-wide infrastructure and removed tooling repo-wide infrastructure labels Jun 9, 2022
@mhofman
Copy link
Member Author

mhofman commented Aug 29, 2023

A post run step added by restore-node might do the trick. See actions/runner#1478 and https://github.com/marketplace/actions/run-and-post-run-action

@rabi-siddique
Copy link
Contributor

rabi-siddique commented Jul 29, 2024

@mhofman I'm not sure if this issue is still ongoing since it was removed from the Engineering Items, but it is still open.

A possible solution I thought of was to create a reusable script that runs a simple git status check after each job in our CI pipeline. Something like:

git_status=$(git status --porcelain)

if [ -n "$git_status" ]; then
  echo "Git tree is dirty: ${git_status}"
  exit 1
fi

echo "Git tree is clean."
exit 0

@rabi-siddique rabi-siddique self-assigned this Jul 29, 2024
@mhofman
Copy link
Member Author

mhofman commented Jul 30, 2024

I would very much prefer to avoid modifying every workflow to add this check. Running as a post run step of "restore-node" if possible sounds a lot more reusable since all workflows use that action.

@rabi-siddique
Copy link
Contributor

@mhofman Do you think we should close this issue now?

@mhofman
Copy link
Member Author

mhofman commented Aug 7, 2024

Done with #9804

@mhofman mhofman closed this as completed Aug 7, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request tooling repo-wide infrastructure
Projects
None yet
Development

No branches or pull requests

3 participants