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

Better handling of undefined values in branches #1101

Merged

Conversation

jmhobbs
Copy link
Contributor

@jmhobbs jmhobbs commented Oct 18, 2024

Sometimes our automatic CI detection lands us with an undefined:<branch> value, which is not correct.

This strips that from branch values (unless explicitly set), and prints a warning message so users can possibly switch to CHROMATIC_BRANCH and CHROMATIC_SLUG

Screenshot 2024-10-18 at 11 54 31 AM

Also upgrades env-ci to detect more CI builders and hopefully avoid this situation in the first place.

📦 Published PR as canary version: 11.13.1--canary.1101.11444008898.0

✨ Test out this PR locally via:

npm install [email protected]
# or 
yarn add [email protected]

@jmhobbs jmhobbs requested a review from a team October 18, 2024 16:55
@jmhobbs jmhobbs self-assigned this Oct 18, 2024
Copy link

Coverage summary from Codacy

See diff coverage on Codacy

Coverage variation Diff coverage
+0.07% (target: -1.00%) 85.00% (target: 80.00%)
Coverage variation details
Coverable lines Covered lines Coverage
Common ancestor commit (b4170a8) 8526 4661 54.67%
Head commit (925b5f0) 8546 (+20) 4678 (+17) 54.74% (+0.07%)

Coverage variation is the difference between the coverage for the head and common ancestor commits of the pull request branch: <coverage of head commit> - <coverage of common ancestor commit>

Diff coverage details
Coverable lines Covered lines Diff coverage
Pull request (#1101) 20 17 85.00%

Diff coverage is the percentage of lines that are covered by tests out of the coverable lines that the pull request added or modified: <covered lines added or modified>/<coverable lines added or modified> * 100%

See your quality gate settings    Change summary preferences

Codacy stopped sending the deprecated coverage status on June 5th, 2024. Learn more

Copy link
Contributor

github-actions bot commented Oct 18, 2024

📦 Package Size: 5264 KB
✅ Compared to main: -4 KB 9ae5118 (5268 KB)

@jmhobbs jmhobbs added patch Auto: Increment the patch version when merged skip-release Auto: Preserve the current version when merged labels Oct 18, 2024
@jmhobbs
Copy link
Contributor Author

jmhobbs commented Oct 18, 2024

@winkerVSbecks is there a better link I should use for this? I found https://www.chromatic.com/docs/custom-ci-provider/#overriding-chromatics-branch-detection but it does not mention CHROMATIC_BRANCH or CHROMATIC_SLUG on there.

@winkerVSbecks
Copy link
Member

winkerVSbecks commented Oct 18, 2024

@jmhobbs We could add an FAQ for precisely this scenario and link to that. wdty?

@jmhobbs
Copy link
Contributor Author

jmhobbs commented Oct 18, 2024

@jmhobbs We could add an FAQ for precisely this scenario and link to that. wdty?

Absolutely! I'll put this on hold for now until that is available.

@jmhobbs jmhobbs added the DO NOT MERGE Block: Prevent merging this PR label Oct 18, 2024
@winkerVSbecks
Copy link
Member

@jmhobbs FAQ link that you can use instead: https://www.chromatic.com/docs/faq/override-branch-name/

Copy link
Contributor

@codykaup codykaup left a comment

Choose a reason for hiding this comment

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

LGTM!

@jmhobbs jmhobbs removed the DO NOT MERGE Block: Prevent merging this PR label Oct 18, 2024
Copy link

codacy-production bot commented Oct 18, 2024

Coverage summary from Codacy

See diff coverage on Codacy

Coverage variation Diff coverage
Report missing for 9ae51181 84.21% (target: 80.00%)
Coverage variation details
Coverable lines Covered lines Coverage
Common ancestor commit (9ae5118) Report Missing Report Missing Report Missing
Head commit (5d55843) 8545 4677 54.73%

Coverage variation is the difference between the coverage for the head and common ancestor commits of the pull request branch: <coverage of head commit> - <coverage of common ancestor commit>

Diff coverage details
Coverable lines Covered lines Diff coverage
Pull request (#1101) 19 16 84.21%

Diff coverage is the percentage of lines that are covered by tests out of the coverable lines that the pull request added or modified: <covered lines added or modified>/<coverable lines added or modified> * 100%

See your quality gate settings    Change summary preferences

Codacy stopped sending the deprecated coverage status on June 5th, 2024. Learn more

Footnotes

  1. Codacy didn't receive coverage data for the commit, or there was an error processing the received data. Check your integration for errors and validate that your coverage setup is correct.

@codykaup codykaup force-pushed the jmhobbs/cap-2210-better-cli-handling-of-undefined-branches branch from 020eedf to 5d55843 Compare October 18, 2024 20:03
@jmhobbs jmhobbs added this pull request to the merge queue Oct 21, 2024
Merged via the queue into main with commit 94f914e Oct 21, 2024
20 checks passed
@jmhobbs jmhobbs deleted the jmhobbs/cap-2210-better-cli-handling-of-undefined-branches branch October 21, 2024 15:22
@chromatic-ci-bot
Copy link
Collaborator

🚀 PR was released in v11.13.0 🚀

@chromatic-ci-bot chromatic-ci-bot added the released Verdict: This issue/pull request has been released label Oct 21, 2024
@chromaui chromaui deleted a comment from sentry-io bot Oct 29, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
patch Auto: Increment the patch version when merged released Verdict: This issue/pull request has been released skip-release Auto: Preserve the current version when merged
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants