Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

benceruleanlu
Copy link
Member

@benceruleanlu benceruleanlu commented Sep 11, 2025

Summary

Adds a manually triggered github workflow to publish frontend types versions to npm.

Takes a version and dist_tag.

Checksout to version, builds types, verifies given version matches built version, publishes to npm given dist_tag.

┆Issue is synchronized with this Notion page by Unito

@benceruleanlu benceruleanlu requested a review from a team as a code owner September 11, 2025 18:45
@dosubot dosubot bot added the size:M This PR changes 30-99 lines, ignoring generated files. label Sep 11, 2025
Copy link
Member Author

@benceruleanlu benceruleanlu left a comment

Choose a reason for hiding this comment

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

This will be needed to republish versions from 1.26.7 to 1.27.2 inclusive.

Copy link

github-actions bot commented Sep 11, 2025

🎭 Playwright Test Results

All tests passed!

⏰ Completed at: 09/15/2025, 08:25:56 PM UTC

📈 Summary

  • Total Tests: 450
  • Passed: 421 ✅
  • Failed: 0
  • Flaky: 0
  • Skipped: 29 ⏭️

📊 Test Reports by Browser

  • chromium: View Report • ✅ 414 / ❌ 0 / ⚠️ 0 / ⏭️ 29
  • chromium-2x: View Report • ✅ 2 / ❌ 0 / ⚠️ 0 / ⏭️ 0
  • chromium-0.5x: View Report • ✅ 1 / ❌ 0 / ⚠️ 0 / ⏭️ 0
  • mobile-chrome: View Report • ✅ 4 / ❌ 0 / ⚠️ 0 / ⏭️ 0

🎉 Click on the links above to view detailed test results for each browser configuration.

DrJKL
DrJKL previously approved these changes Sep 11, 2025
Copy link
Contributor

@christian-byrne christian-byrne left a comment

Choose a reason for hiding this comment

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

Should we add this to the release process? And remove this:

publish_types:
needs: build
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Install pnpm
uses: pnpm/action-setup@v4
with:
version: 10
- uses: actions/setup-node@v4
with:
node-version: 'lts/*'
cache: 'pnpm'
registry-url: https://registry.npmjs.org
- name: Cache tool outputs
uses: actions/cache@v4
with:
path: |
.cache
tsconfig.tsbuildinfo
dist
key: types-tools-cache-${{ runner.os }}-${{ hashFiles('**/pnpm-lock.yaml') }}
restore-keys: |
types-tools-cache-${{ runner.os }}-
- run: pnpm install --frozen-lockfile
- run: pnpm build:types
- name: Publish package
run: pnpm publish --access public
working-directory: dist
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}

@benceruleanlu
Copy link
Member Author

Should we add this to the release process? And remove this:

publish_types:
needs: build
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Install pnpm
uses: pnpm/action-setup@v4
with:
version: 10
- uses: actions/setup-node@v4
with:
node-version: 'lts/*'
cache: 'pnpm'
registry-url: https://registry.npmjs.org
- name: Cache tool outputs
uses: actions/cache@v4
with:
path: |
.cache
tsconfig.tsbuildinfo
dist
key: types-tools-cache-${{ runner.os }}-${{ hashFiles('**/pnpm-lock.yaml') }}
restore-keys: |
types-tools-cache-${{ runner.os }}-
- run: pnpm install --frozen-lockfile
- run: pnpm build:types
- name: Publish package
run: pnpm publish --access public
working-directory: dist
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}

sure let me investigate deduping these two

@benceruleanlu benceruleanlu changed the title Add workflow Add publish frontend types workflow Sep 11, 2025
@dosubot dosubot bot added size:L This PR changes 100-499 lines, ignoring generated files. and removed size:M This PR changes 30-99 lines, ignoring generated files. labels Sep 11, 2025
@christian-byrne christian-byrne added the claude-review Add to trigger a PR code review from Claude Code label Sep 12, 2025
Copy link

@claude claude bot left a comment

Choose a reason for hiding this comment

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

Comprehensive PR Review

This review is generated by Claude. It may not always be accurate, as with human reviewers. If you believe that any of the comments are invalid or incorrect, please state why for each. For others, please implement the changes in one way or another.

Review Summary

PR: Add publish frontend types workflow (#5495)
Impact: 116 additions, 32 deletions across 2 files

Issue Distribution

  • Critical: 0
  • High: 0
  • Medium: 3
  • Low: 2

Category Breakdown

  • Architecture: 1 issues
  • Security: 2 issues
  • Performance: 1 issues
  • Code Quality: 2 issues

Key Findings

Architecture & Design

The PR successfully refactors the type publishing logic from release.yaml into a reusable workflow. This follows good CI/CD practices by creating modular, reusable workflows. The new workflow supports both manual triggering and workflow_call invocation, providing flexibility for different publishing scenarios.

Security Considerations

Two medium-priority security concerns were identified:

  1. Input validation missing: The 'ref' parameter lacks validation, potentially allowing malicious git references
  2. Version format validation: The version input should be validated against semantic versioning patterns to prevent injection attacks

Performance Impact

The workflow uses fetch-depth: 0 which may be unnecessary for a simple build-and-publish operation, potentially impacting checkout performance.

Integration Points

The refactoring properly maintains the existing release workflow functionality while adding the ability to manually publish types. The use of secrets: inherit ensures proper npm token access.

Positive Observations

  • Clean separation of concerns by extracting type publishing into its own workflow
  • Proper use of GitHub Actions best practices (concurrency control, conditional publishing)
  • Includes version verification to prevent publishing mismatched versions
  • Implements duplicate publication checks to avoid unnecessary publishes
  • Good use of workflow_call for reusability

References

Next Steps

  1. Address medium-priority security issues (input validation)
  2. Consider standardizing action versions across workflows
  3. Evaluate if full git history is needed for the build process
  4. Test the manual workflow trigger functionality

This is a comprehensive automated review. For architectural decisions requiring human judgment, please request additional manual review.

@benceruleanlu benceruleanlu requested review from christian-byrne and removed request for christian-byrne September 15, 2025 20:11
run: |
set -euo pipefail
VERSION="${{ inputs.version }}"
SEMVER_REGEX='^(0|[1-9][0-9]*)\.(0|[1-9][0-9]*)\.(0|[1-9][0-9]*)(-((0|[1-9][0-9]*|[0-9]*[A-Za-z-][0-9A-Za-z-]*)(\.(0|[1-9][0-9]*|[0-9]*[A-Za-z-][0-9A-Za-z-]*))*))?(\+([0-9A-Za-z-]+(\.[0-9A-Za-z-]+)*))?$'
Copy link
Member Author

Choose a reason for hiding this comment

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

steps:
- name: Checkout code
uses: actions/checkout@v4
uses: actions/checkout@v5
Copy link
Member Author

Choose a reason for hiding this comment

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

@christian-byrne christian-byrne merged commit 9918914 into main Sep 15, 2025
21 checks passed
@christian-byrne christian-byrne deleted the bl-republish-workflow branch September 15, 2025 21:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
claude-review Add to trigger a PR code review from Claude Code size:L This PR changes 100-499 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants