-
Notifications
You must be signed in to change notification settings - Fork 277
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
ci(workflows): added automatic upgrade function for external test packages #2804
Conversation
WalkthroughThis pull request introduces modifications to the release workflow and CLI for alpha releases. The changes remove branch name validation checks in GitHub Actions workflows for renderless theme and UI publishing. Additionally, the CLI's release alpha command now supports an optional Changes
Sequence DiagramsequenceDiagram
participant CLI
participant ReleaseProcess
participant NPM
participant Packages
CLI->>ReleaseProcess: Execute release:alpha
alt With -u flag
ReleaseProcess->>NPM: Check current package versions
NPM-->>ReleaseProcess: Return current versions
ReleaseProcess->>Packages: Update patch versions
else Without -u flag
ReleaseProcess->>Packages: Proceed without version changes
end
ReleaseProcess->>CLI: Complete release process
Possibly related PRs
Suggested labels
Suggested reviewers
Poem
Finishing Touches
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
WalkthroughThis PR introduces an automatic upgrade function for external test packages in the CI workflows. It modifies the release process to include an option for automatically upgrading the patch version of packages. The changes involve updates to workflow files and the release script to support this new functionality. Changes
|
[e2e-test-warn] The title of the Pull request should look like "fix(vue-renderless): [action-menu, alert] fix xxx bug". Please make sure you've read our contributing guide |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 2
🧹 Nitpick comments (2)
internals/cli/src/commands/release/releaseAlpha.ts (1)
50-54
: Add type safety to releaseAlpha function.The function should use proper TypeScript types for its parameters.
Apply this improvement:
-export const releaseAlpha = ({ updateVersion }) => { +interface ReleaseAlphaOptions { + updateVersion: boolean; +} + +export const releaseAlpha = ({ updateVersion }: ReleaseAlphaOptions) => { const distLists = ['dist3/', 'dist2/', 'renderless/dist', 'theme/dist', 'theme-mobile/dist', 'theme-saas/dist'] distLists.forEach((item) => { - findAllpage(pathFromPackages(item), updateVersion) + findAllPages(pathFromPackages(item), { updateVersion }) }) }internals/cli/src/index.ts (1)
12-16
: Consider adding English descriptions for better internationalization.The command descriptions are currently in Chinese, which might be difficult for non-Chinese speaking contributors to understand.
Consider updating the descriptions:
program .command('release:alpha') - .description('转换为组织名为@opentinyvue的包') + .description('Convert packages to @opentinyvue organization') .option('-u, --updateVersion', '是否自动升级patch版本号', false) .action(releaseAlpha)
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (4)
.github/workflows/dispatch-renderless-theme-publish-alpha.yml
(1 hunks).github/workflows/dispatch-ui-publish-alpha.yml
(1 hunks)internals/cli/src/commands/release/releaseAlpha.ts
(1 hunks)internals/cli/src/index.ts
(1 hunks)
⏰ Context from checks skipped due to timeout of 90000ms (1)
- GitHub Check: PR Unit Test
🔇 Additional comments (2)
.github/workflows/dispatch-ui-publish-alpha.yml (1)
55-55
: LGTM!The addition of the
-u
flag aligns with the CLI changes to enable automatic version updates..github/workflows/dispatch-renderless-theme-publish-alpha.yml (1)
84-84
: LGTM!The addition of the
-u
flag aligns with the CLI changes to enable automatic version updates.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 2
🧹 Nitpick comments (2)
internals/cli/src/commands/release/releaseAlpha.ts (1)
50-54
: Add TypeScript type definitions.The function parameters should have proper TypeScript type definitions for better type safety.
-export const releaseAlpha = ({ updateVersion }) => { +interface ReleaseAlphaOptions { + updateVersion?: boolean; +} + +export const releaseAlpha = ({ updateVersion }: ReleaseAlphaOptions) => { const distLists = ['dist3/', 'dist2/', 'renderless/dist', 'theme/dist', 'theme-mobile/dist', 'theme-saas/dist'] distLists.forEach((item) => { - findAllpage(pathFromPackages(item), updateVersion) + findAllPages(pathFromPackages(item), updateVersion) }) }internals/cli/src/index.ts (1)
12-16
: Consider adding English translations for option descriptions.For better international developer experience, consider providing English translations for the command and option descriptions.
program .command('release:alpha') - .description('转换为组织名为@opentinyvue的包') + .description('Convert packages to @opentinyvue organization') .option('-u, --updateVersion', '是否自动升级patch版本号', false) + .option('-u, --updateVersion', 'Automatically upgrade patch version number', false) .action(releaseAlpha)
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (4)
.github/workflows/dispatch-renderless-theme-publish-alpha.yml
(1 hunks).github/workflows/dispatch-ui-publish-alpha.yml
(1 hunks)internals/cli/src/commands/release/releaseAlpha.ts
(1 hunks)internals/cli/src/index.ts
(1 hunks)
🔇 Additional comments (2)
.github/workflows/dispatch-ui-publish-alpha.yml (1)
55-55
: Verify the implications of removing branch name validation.The removal of branch name validation could potentially allow releases from unintended branches. Please ensure this aligns with the project's release strategy.
✅ Verification successful
Branch validation removal is acceptable in this context.
The workflow's security is maintained through:
- Manual trigger requirement (workflow_dispatch)
- Required component selection input
- NPM token protection for publishing
- Explicit checkout reference using github.ref_name
🏁 Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash # Check current branch patterns used in alpha releases git branch -r | grep -E 'alpha|release'Length of output: 41
Script:
#!/bin/bash # Check the current workflow file echo "=== Current workflow file ===" cat .github/workflows/dispatch-ui-publish-alpha.yml echo -e "\n=== Related workflow files ===" fd "workflow" .github/workflows --type f --exec cat {} echo -e "\n=== Package.json release scripts ===" fd "package.json" --type f --exec sh -c 'echo "=== $1 ==="; cat "$1" | jq -r ".scripts | select(. != null)"' sh {}Length of output: 46409
.github/workflows/dispatch-renderless-theme-publish-alpha.yml (1)
84-84
: Changes are consistent with UI workflow.The modifications align with the changes made in the UI publish workflow, maintaining consistency across the release processes.
PR
添加外部测试包自动升级patch版本号功能
PR Checklist
Please check if your PR fulfills the following requirements:
PR Type
What kind of change does this PR introduce?
What is the current behavior?
Issue Number: N/A
What is the new behavior?
Does this PR introduce a breaking change?
Other information
Summary by CodeRabbit
New Features
-u
flag to therelease:alpha
command.Workflow Changes
Improvements