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

build(ci): Provide diff for pre-commit failures #25638

Merged
merged 1 commit into from
Oct 13, 2023

Conversation

jsoref
Copy link
Contributor

@jsoref jsoref commented Oct 13, 2023

SUMMARY

when pre-commit fails, it's typically because of changes made by one of the tools. As it knows what the changes are, this change provides access to people so that they can use patch -p1 to apply the changes instead of just being frustrated by an unhelpful CI.

BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF

Before:
https://github.com/apache/superset/actions/runs/6507284267/job/17674397883
image

After:
https://github.com/check-spelling-sandbox/superset/actions/runs/6509697746/job/17681762469
image

TESTING INSTRUCTIONS

  1. Make a change to a helm chart that's incomplete such that pre-commit will fail.
  2. Make a PR to a branch with this modified workflow

ADDITIONAL INFORMATION

  • Has associated issue:
  • Required feature flags:
  • Changes UI
  • Includes DB Migration (follow approval process in SIP-59)
    • Migration is atomic, supports rollback & is backwards-compatible
    • Confirm DB migration upgrade and downgrade tested
    • Runtime estimates and downtime expectations provided
  • Introduces new feature or API
  • Removes existing feature or API

Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com>
Copy link
Member

@craig-rueda craig-rueda left a comment

Choose a reason for hiding this comment

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

LGTM! Let's try this out

Copy link
Member

@rusackas rusackas left a comment

Choose a reason for hiding this comment

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

Thanks! Pinging @craig-rueda to see if he has any objections since he knows more about the helm risks than I do.

@rusackas rusackas added the review:checkpoint Last PR reviewed during the daily review standup label Oct 13, 2023
@craig-rueda craig-rueda merged commit 5054b9f into apache:master Oct 13, 2023
27 checks passed
@jsoref jsoref deleted the pre-commit-diff branch October 13, 2023 19:02
@john-bodley john-bodley removed the review:checkpoint Last PR reviewed during the daily review standup label Oct 16, 2023
@@ -86,7 +86,12 @@ jobs:
echo "HOMEBREW_REPOSITORY=$HOMEBREW_REPOSITORY" >>"${GITHUB_ENV}"
brew install norwoodj/tap/helm-docs
- name: pre-commit
run: pre-commit run --all-files
Copy link
Member

@john-bodley john-bodley Oct 17, 2023

Choose a reason for hiding this comment

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

@jsoref and @craig-rueda would the pre-commit run --show-diff-on-failure flag be suffice?

--show-diff-on-failure    When hooks fail, run `git diff` directly afterward.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Maybe. I don't use this tool. As long as I can apply the diff and get it not to fail going forward.

Copy link
Member

Choose a reason for hiding this comment

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

Seems like a good idea. I don't know much about pre commit tbh

cccs-rc pushed a commit to CybercentreCanada/superset that referenced this pull request Mar 6, 2024
Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com>
@mistercrunch mistercrunch added 🏷️ bot A label used by `supersetbot` to keep track of which PR where auto-tagged with release labels 🚢 3.1.0 labels Mar 8, 2024
sfirke pushed a commit to sfirke/superset that referenced this pull request Mar 22, 2024
Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🏷️ bot A label used by `supersetbot` to keep track of which PR where auto-tagged with release labels size/XS 🚢 3.1.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants