Skip to content
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

Fixes for auto-numbering of MIPs #45

Merged
merged 8 commits into from
May 31, 2024
Merged

Fixes for auto-numbering of MIPs #45

merged 8 commits into from
May 31, 2024

Conversation

vandan
Copy link
Collaborator

@vandan vandan commented May 23, 2024

Update the template with the right placeholder string that the action will replace with the appropriate MIP number.

Also retroactively applies the new format to existing MIPs.

Update the template with the right placeholder string that the action will replace with the appropriate MIP number.

Also retroactively applies the new format to existing MIPs.
Add file naming guidelines
MIP-Template.md Outdated Show resolved Hide resolved
improves frontmatter and includes an update to the regular expression that will be used to automatically set MIP numbers.
These changes ensures that automatic MIP numbering can be applied to multiple mip-x.md files with each merged PR. Multiple files can be specified as "mip-x.md", mip-x-foo.md", and "mip-x-bar.md". If the current MIP number was 10, these would be renamed to: mip-10.md, mip-11.md, mip-12.md, respectively.
@vandan
Copy link
Collaborator Author

vandan commented May 25, 2024

Added some adjustments that intend to enable the script to accept PRs with multiple MIP files.
If current MIP number was 10, then the script should assign and rename the following files in a PR as follows:
mip-x.md -> mip-10.md
mip-x-foo.md -> mip-11.md
mip-x-bar.md -> mip-12.md

I figured we might as well make automatic MIP number assignment flexible to allow for multiple MIPs to come through in one PR.

.github/.DS_Store Outdated Show resolved Hide resolved

const oldFilePath = path.join(MIPsFolderPath, "mip-x.md");
const newFilePath = path.join(MIPsFolderPath, `mip-${nextMIPNumber}.md`);
const oldFilePath = path.join(MIPsFolderPath, "mip-x.md");
Copy link
Collaborator

Choose a reason for hiding this comment

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

I'm not fully understanding how this script is able to assign multiple mip file names if this loop is hardcoded to only target mip-x.md

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Thanks, I attempted to make some changes to match on files matching the pattern mip-x*.md and then apply the automatic numbering to them.

vandan and others added 4 commits May 29, 2024 13:46
remove and exclude in .gitignore
Delete .DS_Store
Iterates through the mip-x*.md files and applies automatic numbering to them.
Copy link
Collaborator

Choose a reason for hiding this comment

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

ideally this template change would have come in a separate PR before this one, but not that big of a deal


execSync(`git add ${oldFilePath} ${newFilePath}`);
execSync(`git add "${oldFilePath}" "${newFilePath}"`);
Copy link
Collaborator

Choose a reason for hiding this comment

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

i wrapped these paths in quotes to ensure whitespace doesn't break the command

@vandan vandan merged commit af246ca into main May 31, 2024
2 checks passed
@vandan vandan deleted the vandan/template-fix branch May 31, 2024 18:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants