Skip to content

[code-infra] Setup internal package publishing#5142

Draft
brijeshb42 wants to merge 2 commits into
mui:masterfrom
brijeshb42:publish-internal
Draft

[code-infra] Setup internal package publishing#5142
brijeshb42 wants to merge 2 commits into
mui:masterfrom
brijeshb42:publish-internal

Conversation

@brijeshb42

Copy link
Copy Markdown
Contributor

@brijeshb42 brijeshb42 added the scope: code-infra Involves the code-infra product (https://www.notion.so/mui-org/5562c14178aa42af97bc1fa5114000cd). label Jun 30, 2026
@pkg-pr-new

pkg-pr-new Bot commented Jun 30, 2026

Copy link
Copy Markdown

commit: 564a79c

@code-infra-dashboard

code-infra-dashboard Bot commented Jun 30, 2026

Copy link
Copy Markdown

Bundle size

Bundle Parsed size Gzip size
@base-ui/react 0B(0.00%) 0B(0.00%)

Details of bundle changes

Performance

Total duration: 1,202.91 ms -100.08 ms(-7.7%) | Renders: 78 (+0)

Test Duration Renders
Select open (500 options) 58.01 ms 🔺+12.67 ms(+28.0%) 14 (+0)

13 tests within noise — details

Metric alarms

Test Metric Change
Select open (500 options) bench:paint 🔺 +23.83 ms
Select open (500 options) bench:paint#select-open 🔺 +23.83 ms

Check out the code infra dashboard for more information about this PR.

@netlify

netlify Bot commented Jun 30, 2026

Copy link
Copy Markdown

Deploy Preview for base-ui ready!

Built without sensitive environment variables

Name Link
🔨 Latest commit 564a79c
🔍 Latest deploy log https://app.netlify.com/projects/base-ui/deploys/6a43acc78b14610008ea0fe4
😎 Deploy Preview https://deploy-preview-5142--base-ui.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.
🤖 Make changes Run an agent on this branch

To edit notification comments on pull requests, go to your Netlify project configuration.

Comment thread package.json
"release:publish": "code-infra publish --github-release",
"release:publish:dry-run": "code-infra publish --github-release --dry-run ",
"release:publish:dry-run": "code-infra publish --github-release --dry-run",
"release:publish:internal": "code-infra publish -- --internal-packages",

@Janpot Janpot Jun 30, 2026

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

🤔 I still don't fully understand what we get out of this. Why is it not just the responsibility of the releaser to only bump the version of what needs to be published? A special mode for internal packages is not doing anything special, right?

I mean the points of failure are:

  1. the user versions the correct packages
  2. the user runs the correct command

If we put this in a matrix for a partial release

two commands available

user runs: partial command accidental full command
versions correct publish correct packages publish correct packages
versions incorrect cli errors cli publishes wrong packages

vs.

one command available

user runs: full command
versions correct publish correct packages
versions incorrect cli publishes wrong packages

The failure mode remains the same, the user needs to version correctly.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

A special mode for internal packages is not doing anything special

Right. Nothing special.

This is an extra guardrail from code-infra side to avoid accidentally publishing @base-ui/react since this package has its monthly release cadence associated with the whole repo.

The new job makes it explicit what the internal packages are and only those will get published regardless of whether react's version was bumped or not. This can be updated over time to whitelist other packages as relevant.

@Janpot Janpot Jul 1, 2026

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I kind of feel like the safeguard is in the wrong place. Aren't we only adding it because the version bump is so crude and not adapted to our use-case that errors are easy to happen? Maybe it's the version CLI that needs the safeguard, not the publish one? It's like we're adding complexity to an already complex flow, just to prevent errors from a tool that is not properly adapted to our use-case.

Does the dry run on the CLI print what would be published? Maybe instead we could always do a dry-run, print the result, ask for confirmation, if yes, do for real? This doesn't add any new modes and contains the complexity to a local check only. + improves the UX of the tool.

@brijeshb42 brijeshb42 Jul 1, 2026

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

I don't think people are going to be invoking lerna to bump the version for utils. They'll just update package.json manually. IMO, it doesn't even make sense to be here in this repo with only two packages. It does make sense for core or x where there are more than 10 packages.

@Janpot Janpot Jul 1, 2026

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Ok, and doing the dry-run, then print like

Attention: You are about to execute the followong actions
- publish packages:
  - @base-ui/utils  v1.2.3.
  - ...

- publish a GH release

press [enter] to proceed, press [?] to review the changelog, press [esc] to cancel

? Would that be hard to do? I mean, if you then still accidentally publish, then it really is your own fault.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

But nothing is stopping anyone from triggering the GH workflow directly where we can't have this.

@Janpot Janpot Jul 1, 2026

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

🤔 We should be able to control that using workflow execution protections (maybe, just learnt about this)

Actor rules control who can trigger workflows, including individual users, repository roles such as Read, Maintain, and Admin, GitHub Apps, Copilot, and Dependabot.

I guess we can restrict it to our GitHub App.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

This would work. But how would the cli trigger the action ? It would have to trigger on behalf of the app but then anyone running the cli would be able to trigger it. I am probably missing something.

@Janpot Janpot Jul 1, 2026

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Well, the app runs it on behalf of the user no? Isn't that how our auth works? app requests a token scoped to workflow_dispatch, and the user signs in to create that token, only if the user has the rights to workflow_dispatch.

Not sure if workflow execution protection means the app as the one executing the API, or the app as an owner of credentials.

@github-actions github-actions Bot added the PR: out-of-date The pull request has merge conflicts and can't be merged. label Jul 2, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

PR: out-of-date The pull request has merge conflicts and can't be merged. scope: code-infra Involves the code-infra product (https://www.notion.so/mui-org/5562c14178aa42af97bc1fa5114000cd).

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants