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

Use git status to check for changes to devsite #8448

Merged
merged 4 commits into from
Aug 22, 2024
Merged

Conversation

dlarocque
Copy link
Contributor

The previous check did not account for untracked changes, which caused it to output false-positives in two cases.

  1. If an existing file in docs-devsite/ was deleted in a previous commit on the PR. yarn docgen:all will regenerate the deleted file, but since it was previously deleted, it will now be untracked, so git diff --exit-code will succeed.
  2. If yarn docgen:all generates a new file, but it doesn't exist in the PR, it will be untracked, so git diff --exit-code will succeed.

We can fix this by instead exiting with code 1 if git status has any output, which will include any untracked changes.

@dlarocque dlarocque requested a review from a team as a code owner August 21, 2024 16:12
Copy link

changeset-bot bot commented Aug 21, 2024

⚠️ No Changeset found

Latest commit: 5692a73

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@google-oss-bot
Copy link
Contributor

google-oss-bot commented Aug 21, 2024

@google-oss-bot
Copy link
Contributor

google-oss-bot commented Aug 21, 2024

@dlarocque dlarocque force-pushed the dl/fix-devsite-checker branch from 992208a to 89eabf0 Compare August 21, 2024 17:10
Copy link
Contributor

@hsubox76 hsubox76 left a comment

Choose a reason for hiding this comment

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

LG, thanks for catching!

@@ -36,7 +36,12 @@ jobs:
- name: Run doc generation
run: yarn docgen:all
- name: Check for changes in docs-devsite dir (fail if so)
run: git diff --exit-code docs-devsite
run: |
if [[ -n "$(git status docs-devsite --porcelain)" ]]; then
Copy link
Contributor

Choose a reason for hiding this comment

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

What an odd name for a command line option.

@dlarocque dlarocque merged commit 4c2c78b into main Aug 22, 2024
35 checks passed
@dlarocque dlarocque deleted the dl/fix-devsite-checker branch August 22, 2024 14:17
@firebase firebase locked and limited conversation to collaborators Sep 22, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants