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

UI: Keep failing stories in the sidebar, disregarding filters #30086

Merged
merged 2 commits into from
Dec 17, 2024

Conversation

JReinhold
Copy link
Contributor

@JReinhold JReinhold commented Dec 17, 2024

Closes #29653

What I did

Before applying filters to the index, we first check if the entry has a failing status. If it does, always keep it in the filtered index.

Checklist for Contributors

Testing

The changes in this PR are covered in the following automated tests:

  • stories
  • unit tests
  • integration tests
  • end-to-end tests

Manual testing

This section is mandatory for all contributions. If you believe no manual test is necessary, please state so explicitly. Thanks!

Documentation

  • Add or update documentation reflecting your changes
  • If you are deprecating/removing a feature, make sure to update
    MIGRATION.MD

Checklist for Maintainers

  • When this PR is ready for testing, make sure to add ci:normal, ci:merged or ci:daily GH label to it to run a specific set of sandboxes. The particular set of sandboxes can be found in code/lib/cli-storybook/src/sandbox-templates.ts

  • Make sure this PR contains one of the labels below:

    Available labels
    • bug: Internal changes that fixes incorrect behavior.
    • maintenance: User-facing maintenance tasks.
    • dependencies: Upgrading (sometimes downgrading) dependencies.
    • build: Internal-facing build tooling & test updates. Will not show up in release changelog.
    • cleanup: Minor cleanup style change. Will not show up in release changelog.
    • documentation: Documentation only changes. Will not show up in release changelog.
    • feature request: Introducing a new feature.
    • BREAKING CHANGE: Changes that break compatibility in some way with current major version.
    • other: Changes that don't fit in the above categories.

🦋 Canary release

This PR does not have a canary release associated. You can request a canary release of this pull request by mentioning the @storybookjs/core team here.

core team members can create a canary release here or locally with gh workflow run --repo storybookjs/storybook canary-release-pr.yml --field pr=<PR_NUMBER>

name before after diff z %
createSize 0 B 0 B 0 B - -
generateSize 77.7 MB 77.7 MB 0 B 0.63 0%
initSize 136 MB 136 MB 216 B 0.42 0%
diffSize 58.4 MB 58.4 MB 216 B 0.42 0%
buildSize 7.24 MB 7.24 MB 72 B 0.23 0%
buildSbAddonsSize 1.88 MB 1.88 MB 0 B 0.23 0%
buildSbCommonSize 195 kB 195 kB 0 B - 0%
buildSbManagerSize 1.86 MB 1.86 MB 72 B 3.87 0%
buildSbPreviewSize 0 B 0 B 0 B - -
buildStaticSize 0 B 0 B 0 B - -
buildPrebuildSize 3.93 MB 3.93 MB 72 B 0.23 0%
buildPreviewSize 3.3 MB 3.3 MB 0 B -0.27 0%
testBuildSize 0 B 0 B 0 B - -
testBuildSbAddonsSize 0 B 0 B 0 B - -
testBuildSbCommonSize 0 B 0 B 0 B - -
testBuildSbManagerSize 0 B 0 B 0 B - -
testBuildSbPreviewSize 0 B 0 B 0 B - -
testBuildStaticSize 0 B 0 B 0 B - -
testBuildPrebuildSize 0 B 0 B 0 B - -
testBuildPreviewSize 0 B 0 B 0 B - -
name before after diff z %
createTime 26.8s 27s 219ms 1.68 0.8%
generateTime 19.7s 27s 7.2s 5.74 🔺26.9%
initTime 14.8s 18.5s 3.6s 3.64 🔺19.7%
buildTime 8.3s 8.7s 370ms -0.7 4.2%
testBuildTime 0ms 0ms 0ms - -
devPreviewResponsive 5.1s 4.8s -267ms -0.36 -5.5%
devManagerResponsive 3.9s 3.7s -270ms -0.31 -7.3%
devManagerHeaderVisible 884ms 594ms -290ms -0.26 -48.8%
devManagerIndexVisible 973ms 625ms -348ms -0.32 -55.7%
devStoryVisibleUncached 1.9s 1.7s -216ms -0.21 -12.3%
devStoryVisible 970ms 626ms -344ms -0.32 -55%
devAutodocsVisible 679ms 530ms -149ms -0.13 -28.1%
devMDXVisible 718ms 522ms -196ms -0.33 -37.5%
buildManagerHeaderVisible 633ms 584ms -49ms -0.47 -8.4%
buildManagerIndexVisible 753ms 677ms -76ms -0.44 -11.2%
buildStoryVisible 589ms 547ms -42ms -0.39 -7.7%
buildAutodocsVisible 485ms 456ms -29ms -0.16 -6.4%
buildMDXVisible 499ms 430ms -69ms -0.58 -16%

Greptile Summary

Modified the story filtering logic to ensure failing stories remain visible in the sidebar regardless of applied filters.

  • Added failing story bypass in code/core/src/manager-api/lib/stories.ts to preserve stories with error status
  • Added test case in code/core/src/manager-api/lib/stories.test.ts verifying failing stories remain visible despite filters
  • Fixed issue [Bug]: Failing stories without 'dev' tag can't be seen in the sidebar #29653 where failing stories without 'dev' tag were hidden from sidebar

@JReinhold JReinhold self-assigned this Dec 17, 2024
Copy link
Member

@shilman shilman left a comment

Choose a reason for hiding this comment

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

Amazing!!! ❤️

Is there any way to clear the status??

@JReinhold
Copy link
Contributor Author

There is not.

Copy link

nx-cloud bot commented Dec 17, 2024

☁️ Nx Cloud Report

CI is running/has finished running commands for commit dfe06f6. As they complete they will appear below. Click to see the status, the terminal output, and the build insights.

📂 See all runs for this CI Pipeline Execution


✅ Successfully ran 1 target

Sent with 💌 from NxCloud.

@JReinhold JReinhold marked this pull request as ready for review December 17, 2024 12:34
@JReinhold JReinhold merged commit dc462b8 into next Dec 17, 2024
61 of 69 checks passed
@JReinhold JReinhold deleted the jeppe+ndelangen/fix-failing-tests-filter branch December 17, 2024 12:34
Copy link
Contributor

@greptile-apps greptile-apps bot left a comment

Choose a reason for hiding this comment

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

2 file(s) reviewed, 2 comment(s)
Edit PR Review Bot Settings | Greptile

Comment on lines +271 to +273
expect(Object.keys(result)).toHaveLength(2);
expect(result['story-1']).toBeTruthy();
expect(result['1']).toBeTruthy();
Copy link
Contributor

Choose a reason for hiding this comment

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

logic: Test is asserting both 'story-1' and '1' keys exist, but this seems incorrect - should only be checking for one ID format based on the transformation logic

Object.values(filters).forEach((filter: any) => {
if (result === false) {
return;
}
result = filter({ ...entry, status: status[entry.id] });
result = filter({ ...entry, status: storyStatus });
Copy link
Contributor

Choose a reason for hiding this comment

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

style: Passing storyStatus directly instead of spreading entry and adding status separately would be more efficient

@github-actions github-actions bot mentioned this pull request Dec 17, 2024
7 tasks
@shilman shilman changed the title Manager: Keep failing stories in the sidebar, disregarding filters UI: Keep failing stories in the sidebar, disregarding filters Dec 18, 2024
@github-actions github-actions bot mentioned this pull request Dec 18, 2024
8 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Bug]: Failing stories without 'dev' tag can't be seen in the sidebar
3 participants