chromaui / chromatic-cli

Chromatic CLI: `npx chromatic`
https://www.chromatic.com/docs/cli
MIT License
289 stars 70 forks source link

Better handling of undefined values in branches #1101

Closed jmhobbs closed 1 month ago

jmhobbs commented 1 month ago

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
:sparkles: Test out this PR locally via: ```bash npm install chromatic@11.13.1--canary.1101.11444008898.0 # or yarn add chromatic@11.13.1--canary.1101.11444008898.0 ```
codacy-production[bot] commented 1 month ago

Coverage summary from Codacy

See diff coverage on Codacy

Coverage variation Diff coverage
:white_check_mark: +0.07% (target: -1.00%) :white_check_mark: 85.00% (target: 80.00%)
Coverage variation details | | Coverable lines | Covered lines | Coverage | | ------------- | ------------- | ------------- | ------------- | | Common ancestor commit (b4170a8f558b03615836bc71eec51830796f267c) | 8526 | 4661 | 54.67% | | | Head commit (925b5f08e956878c66273f09732c2cf05e6c637b) | 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: ` - `
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: `/ * 100%`

See your quality gate settings    Change summary preferences

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

github-actions[bot] commented 1 month ago

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

jmhobbs commented 1 month ago

@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 commented 1 month ago

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

jmhobbs commented 1 month ago

@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.

winkerVSbecks commented 1 month ago

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

codacy-production[bot] commented 1 month ago

Coverage summary from Codacy

See diff coverage on Codacy

Coverage variation Diff coverage
Report missing for 9ae51185d550eba0d8c12b8045b0f6a83c5f5903[^1] :white_check_mark: 84.21% (target: 80.00%)
Coverage variation details | | Coverable lines | Covered lines | Coverage | | ------------- | ------------- | ------------- | ------------- | | Common ancestor commit (9ae51185d550eba0d8c12b8045b0f6a83c5f5903) | Report Missing | Report Missing | Report Missing | | | Head commit (5d558439ccff22f09dde00c5ee1cf314fabac729) | 8545 | 4677 | 54.73% | **Coverage variation** is the difference between the coverage for the head and common ancestor commits of the pull request branch: ` - `
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: `/ * 100%`

See your quality gate settings    Change summary preferences

Codacy stopped sending the deprecated coverage status on June 5th, 2024. Learn more [^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.

chromatic-ci-bot commented 1 month ago

:rocket: PR was released in v11.13.0 :rocket: