Repository navigation
Feature(size/L): BRU-2542 Choose environments to include and show versions in the Generate Documentation modal - #8268
Conversation
|
Note Reviews pausedIt looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the Use the following commands to manage reviews:
Use the checkboxes below for quick actions:
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (5)
💤 Files with no reviewable changes (1)
🚧 Files skipped from review as they are similar to previous changes (2)
WalkthroughAdds ChangesGenerate Documentation: version info and environment selection
IpcErrorModal pre-element overflow fix
Sequence Diagram(s)sequenceDiagram
participant User
participant GenerateDocumentation
participant EnvironmentSelectionList
participant handleGenerate
rect rgba(70, 130, 180, 0.5)
Note over User, GenerateDocumentation: Modal open
User->>GenerateDocumentation: opens modal
GenerateDocumentation->>EnvironmentSelectionList: environments + selectedEnvUids
end
rect rgba(144, 238, 144, 0.5)
Note over User, EnvironmentSelectionList: Env toggle
User->>EnvironmentSelectionList: unchecks "Development"
EnvironmentSelectionList->>GenerateDocumentation: toggleEnv(uid)
GenerateDocumentation->>GenerateDocumentation: adds uid to deselectedEnvUids
end
rect rgba(255, 165, 0, 0.5)
Note over User, handleGenerate: Generate
User->>GenerateDocumentation: clicks Generate
GenerateDocumentation->>handleGenerate: selectedEnvUids + currentVersion
handleGenerate->>handleGenerate: filters collectionCopy.environments
handleGenerate->>handleGenerate: merges currentVersion into openCollection.info
handleGenerate-->>User: HTML export with filtered envs
end
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~25 minutes Possibly related PRs
Suggested labels
Suggested reviewers
Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Actionable comments posted: 3
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In
`@packages/bruno-app/src/components/Sidebar/Collections/Collection/GenerateDocumentation/CollectionVersionInfo/index.js`:
- Around line 15-22: The version metadata block containing the version label,
version value, and version summary lacks data-testid attributes required for
stable Playwright E2E test assertions. Add data-testid hooks to each testable
element in this section: the outer version-info container div, the version-line
div containing the label and formatted version value, the version-label span,
the version-value span that displays formatCollectionVersion(version), and the
version-summary paragraph that renders the folder and request counts. Use
descriptive testid values that clearly identify each element's purpose for
reliable test targeting.
In `@packages/bruno-app/src/utils/collections/index.js`:
- Around line 933-938: In the `getCollectionItemCounts` function, the
`requestCount` calculation on line 937 includes transient requests but the
export flow excludes them. Modify the filter for requestCount to exclude
transient requests alongside the existing `isItemARequest` check, by adding a
condition that filters out items with transient properties set to true. This
ensures the displayed request counts in the UI match the actual content that
gets exported.
In `@tests/collection/generate-docs/generate-docs.spec.ts`:
- Around line 229-233: The test for generatedEnvironmentNames currently only
checks for the presence of specific environment names using individual toContain
and not.toContain assertions, but does not verify that the complete set matches
exactly what is expected. For this security-sensitive functionality, replace the
individual inclusion/exclusion checks with a single assertion that verifies the
exact array of environment names returned by generatedEnvironmentNames(content)
matches the expected set precisely, ensuring any unexpected environments would
cause the test to fail.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
Run ID: f6d99d4e-c288-4e6b-9187-a4a39726e6ba
📒 Files selected for processing (13)
packages/bruno-app/src/components/Errors/IpcErrorModal/StyledWrapper.jspackages/bruno-app/src/components/Sidebar/Collections/Collection/GenerateDocumentation/CollectionVersionInfo/index.jspackages/bruno-app/src/components/Sidebar/Collections/Collection/GenerateDocumentation/EnvironmentSelectionList/index.jspackages/bruno-app/src/components/Sidebar/Collections/Collection/GenerateDocumentation/StyledWrapper.jspackages/bruno-app/src/components/Sidebar/Collections/Collection/GenerateDocumentation/index.jspackages/bruno-app/src/utils/collections/index.jspackages/bruno-app/src/utils/collections/index.spec.jstests/collection/generate-docs/fixtures/collection/environments/Development.brutests/collection/generate-docs/fixtures/collection/environments/Production.brutests/collection/generate-docs/fixtures/collection/environments/Staging.brutests/collection/generate-docs/generate-docs.spec.tstests/utils/page/actions.tstests/utils/page/locators.ts
Description
Problem
Generated docs include every environment in the collection, with no way to scope which envs ship in the exported docs, so internal, local, or staging envs leak into docs shared externally. The modal also gives no indication of which collection version the docs are generated from.
https://usebruno.atlassian.net/browse/BRU-2542
Contribution Checklist:
Note: Keeping the PR small and focused helps make it easier to review and merge. If you have multiple changes you want to make, please consider submitting them as separate pull requests.
Publishing to New Package Managers
Please see here for more information.
Summary by CodeRabbit
Release Notes
New Features
vprefix) plus folder/request counts.Style / UX
Quality