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

check dirty git tree after running CI jobs #9804

Merged
merged 2 commits into from
Aug 6, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 9 additions & 15 deletions .github/actions/restore-node/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -181,18 +181,12 @@ runs:
mkdir -p node_modules/.cache/agoric
date > node_modules/.cache/agoric/yarn-built

- name: git dirty check
working-directory: ${{ inputs.path }}
shell: bash
run: |-
set -x
# Fail if `git status` reports anything other than the following:
# * an untracked endo-sha.txt from above
# * work tree files that have been staged without further changes
# (e.g., package.json or yarn.lock) as indicated by the Y position
# in "XY PATH" being a space
Comment on lines -189 to -193
Copy link
Member

Choose a reason for hiding this comment

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

Let's make sure we keep this explanation (with an update) around

if [ -n "$(git status --porcelain | grep -vE '^[?][?] endo-sha.txt$|^. '; true)" ]; then
git status
echo "Unexpected dirty git status" 1>&2
exit 1
fi
- name: Validate Git Tree Cleanliness
uses: pyTooling/Actions/with-post-step@v0.4.5
with:
main: |
bash "$SRC/.github/actions/restore-node/check-git-status.sh" "$SRC"
post: |
bash "$SRC/.github/actions/restore-node/check-git-status.sh" "$SRC"
env:
SRC: ${{ inputs.path }}
13 changes: 13 additions & 0 deletions .github/actions/restore-node/check-git-status.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
#!/bin/bash
# Set verbose execution
set -x
# Navigate to the specified directory
cd "$1" || exit $?
# Check for unexpected changes
# Fail if git status detects changes
changes=$(git status --porcelain)
if [ -n "$changes" ]; then
git status
echo "Unexpected dirty git status in Agoric SDK path"
exit 1
fi
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -68,3 +68,7 @@ api-docs

chaintest
_testoutput.txt


junit.xml
endo-sha.txt
1 change: 1 addition & 0 deletions a3p-integration/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ upgrade-test-scripts
# same for each proposal, an independent project
proposals/*/.pnp.*
proposals/*/.yarn/*
proposals/a:upgrade-next/*
Copy link
Member

Choose a reason for hiding this comment

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

I'm not sure about this one, but if you are, I'm still willing to approve.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I'm still in the process of understanding this, as it appears to be intermittent. Sometimes artifacts are generated when the associated workflow runs, and other times they are not.

Copy link
Member

@mhofman mhofman Aug 6, 2024

Choose a reason for hiding this comment

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

That's definitely too broad. Please revert and use a targeted ignore file inside the proposals/a:upgrade-next folder

You should only have to ignore the generated files.

!proposals/*/.yarn/patches
!proposals/*/.yarn/plugins
!proposals/*/.yarn/releases
Expand Down
3 changes: 3 additions & 0 deletions packages/cosmic-swingset/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -87,3 +87,6 @@ typings/

# next.js build output
.next

# rosetta-cli executable
bin/rosetta-cli
Loading