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

Properly check storybookBaseDir against repository root rather than CWD #974

Merged
merged 2 commits into from May 7, 2024

Conversation

ghengeveld
Copy link
Member

@ghengeveld ghengeveld commented May 6, 2024

The storybookBaseDir option was being checked as a relative path, which caused checkStorybookBaseDir to fail when running Storybook from a subdirectory rather than the repository root. This PR ensures we use the repository root rather than the current working directory when checking the storybookBaseDir value.

📦 Published PR as canary version: 11.3.2--canary.974.8981931033.0

✨ Test out this PR locally via:

npm install chromatic@11.3.2--canary.974.8981931033.0
# or 
yarn add chromatic@11.3.2--canary.974.8981931033.0

@@ -22,7 +24,7 @@ export async function checkStorybookBaseDir(ctx: Context, stats: Stats) {
await Promise.any(
sourceModuleFiles.map((file) => {
return limitConcurrency(() => {
const absolutePath = path.join(storybookBaseDir, file.name);
const absolutePath = path.join(repositoryRoot, storybookBaseDir, file.name);
Copy link
Member

Choose a reason for hiding this comment

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

@ghengeveld What is the validity of this suggestion? It seems fair.

Copy link
Member

@thafryer thafryer left a comment

Choose a reason for hiding this comment

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

Ultimately, this looks fine. Can we add a test for this?

Copy link

Coverage summary from Codacy

See diff coverage on Codacy

Coverage variation Diff coverage
Report missing for a82fa621 100.00% (target: 80.00%)
Coverage variation details
Coverable lines Covered lines Coverage
Common ancestor commit (a82fa62) Report Missing Report Missing Report Missing
Head commit (10ac294) 8451 6649 78.68%

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 (#974) 4 4 100.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 will stop sending the deprecated coverage status from 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.

@ghengeveld ghengeveld added this pull request to the merge queue May 7, 2024
Merged via the queue into main with commit c066f80 May 7, 2024
26 of 27 checks passed
@ghengeveld ghengeveld deleted the fix-storybook-base-dir-check branch May 7, 2024 08:09
@ghengeveld
Copy link
Member Author

🚀 PR was released in v11.3.1 🚀

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 release Auto: Create a `latest` release when merged released Verdict: This issue/pull request has been released
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants