Skip to content

Check if git working tree is clean script - #1347

Merged
josephjclark merged 11 commits into
mainfrom
1136-ci-tests
Aug 28, 2025
Merged

josephjclark merged 11 commits into
mainfrom
1136-ci-tests

Conversation

@mtuchi

@mtuchi mtuchi commented Aug 26, 2025 •

Copy link
Copy Markdown
Collaborator

Summary

Add a script for checking if git working tree is clean. This script is used in ci.yaml and publish.yaml workflows

Fixes #1136

Details

  • Add script in scripts/status-check.sh
  • Update package.json to include test:git which uses the new script ☝🏽
  • Update ci.yaml and publish.yaml workflow to include pnpm test:git step

Testing

First, make some uncommitted changes in your working directory. Then run pnpm test:git from the adaptors root directory. You should see an error saying Error: Working tree has uncommitted changes:

I have confirmed the script is working by making a small change to asana docs and commit only Adaptor.js, When i pushed the changes the CI Build and Test Failed. See failed job

AI Usage

Please disclose how you've used AI in this work (it's cool, we just want to
know!):

  • Code generation (copilot but not intellisense)
  • Learning or fact checking
  • Strategy / design
  • Optimisation / refactoring
  • Translation / spellchecking / doc gen
  • Other
  • I have not used AI

You can read more details in our
Responsible AI Policy

Review Checklist

Before merging, the reviewer should check the following items:

  • Does the PR do what it claims to do?
  • NA: If this is a new adaptor, added the adaptor on marketing website ?
  • NA: If this PR includes breaking changes, do we need to update any jobs in
    production? Is it safe to release?
  • Are there any unit tests?
  • NA: Is there a changeset associated with this PR? Should there be? Note that
    dev only changes don't need a changeset.
  • Have you ticked a box under AI Usage?

@mtuchi mtuchi linked an issue Aug 26, 2025 that may be closed by this pull request
@mtuchi
mtuchi requested a review from hunterachieng August 26, 2025 15:41
Comment thread scripts/status-check.sh Outdated
@josephjclark

Copy link
Copy Markdown
Collaborator

Fantastic! Love this:

image

Comment thread scripts/status-check.sh
@@ -0,0 +1,98 @@
#!/bin/bash

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Is this AI generated? It looks a lot more involved and complicated than I expect

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Yes it's mostly ai generate. I was facing some challenge with actions/checkout@v3. Went to AI for help

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

That's OK but make sure to really scrutinise what the AI is telling you. It's like you've handed the work out to an external contractor - sure they've delivered something that looks cool, but is it really what we want? Will the maintenance cost outweigh the development cost?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Noted, thanks for the feedback

Comment thread scripts/status-check.sh Outdated
Comment thread scripts/status-check.sh Outdated
Comment thread scripts/status-check.sh Outdated
Comment thread scripts/status-check.sh
Comment thread scripts/status-check.sh Outdated

@josephjclark josephjclark left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

This is much better @mtuchi - thank you! 🙏

@josephjclark
josephjclark merged commit d4f2aa8 into main Aug 28, 2025
2 checks passed
@josephjclark
josephjclark deleted the 1136-ci-tests branch August 28, 2025 09:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Closed

Development

Successfully merging this pull request may close these issues.

CI tests should fail if the working tree is unclean

4 participants