Skip to content

[core] Allow repo to be accepted as an argument for releaseTag #45801

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

Merged
merged 1 commit into from
Apr 2, 2025

Conversation

brijeshb42
Copy link
Contributor

This will help in reusing this script across repos

@brijeshb42 brijeshb42 requested review from Janpot and a team April 2, 2025 17:11
@mui-bot
Copy link

mui-bot commented Apr 2, 2025

Netlify deploy preview

https://deploy-preview-45801--material-ui.netlify.app/

Bundle size report

No bundle size changes (Toolpad)
No bundle size changes

Generated by 🚫 dangerJS against a7af6ca

@brijeshb42 brijeshb42 changed the title [core] Allo repo to be accepted as an argument for releaseTag [core] Allow repo to be accepted as an argument for releaseTag Apr 2, 2025
@brijeshb42 brijeshb42 added core Infrastructure work going on behind the scenes scope: code-infra Specific to the core-infra product labels Apr 2, 2025
@@ -40,12 +42,12 @@ async function findMuiOrgRemote() {
// - [email protected]:mui/material-ui.git
// but not:
// - [email protected]:mui/material-ui-docs.git
return /mui\/material-ui(\.git)?$/.test(remote.url) && remote.method === '(push)';
return new RegExp(`mui/${repo}(.git)?$`).test(remote.url) && remote.method === '(push)';
Copy link
Member

@Janpot Janpot Apr 2, 2025

Choose a reason for hiding this comment

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

Wouldn't be surprised there's some hidden bugs in this regex still. My advice would be to always avoid regex if proper parsers exist. What do you think about using git-url-parse instead? It's not a new dependency, it's already in the node_modules through lerna.

Copy link
Member

Choose a reason for hiding this comment

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

mui/${repo}(.git)?$
------------^ this is an "anything" wildcard
            | mui/x-chartssgit would match

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Updated to use the parser.

Copy link
Member

@Janpot Janpot Apr 2, 2025

Choose a reason for hiding this comment

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

It would've also matched "not-mui/material-ui.git". 😄

Copy link
Member

@Janpot Janpot left a comment

Choose a reason for hiding this comment

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

Would feel more at ease with better parsing, but ultimately up to you.

@brijeshb42 brijeshb42 force-pushed the code-infra-release-tag branch from 52f35c2 to 468c611 Compare April 2, 2025 17:47
This will help in reusing this script across repos
@brijeshb42 brijeshb42 force-pushed the code-infra-release-tag branch from 468c611 to a7af6ca Compare April 2, 2025 17:54
@brijeshb42 brijeshb42 enabled auto-merge (squash) April 2, 2025 17:59
@brijeshb42 brijeshb42 merged commit f81dd79 into mui:master Apr 2, 2025
19 checks passed
@brijeshb42 brijeshb42 deleted the code-infra-release-tag branch April 2, 2025 18:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
core Infrastructure work going on behind the scenes scope: code-infra Specific to the core-infra product
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants