-
Notifications
You must be signed in to change notification settings - Fork 3.4k
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
Publish sequence update #1065
Publish sequence update #1065
Conversation
We should probably fix the tests first |
I think adding tests to preversion would be a good idea. one less step and it prevents accidentally not checking tests |
|
||
1. **Major:** There is at least one change not deemed backward compatible. While in beta, the major will remain at zero; thereby, alerting consumers to the potentially volatile nature of the package. | ||
2. **Minor:** There is at least one new feature added to the release. While in beta, the minor will tend to be more analagous to a `major` release. For example, we plan to release `0.4.0` once we have fixed most, if not all, known issues related to the CommonMark and GFM specifications because the architecture changes planned during `0.4.0` will most likely introduce breaking changes. | ||
3. **Patch:** No breaking changes. Should fix a defect found in a feature. While in beta, the patch will tend to be more analagous to a `minor` release. |
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.
analogous
RELEASE.md
Outdated
- `$ npm test` (run tests) | ||
- `$ npm version [major|minor|patch]` (updates `package.json` and creates `min` file) | ||
- `$ npm publish` (publish to NPM) | ||
- [ ] Commit changes locally -> Submit PR to `origina/master` -> Merge PR |
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.
origin
@@ -33,6 +33,7 @@ | |||
"scripts": { | |||
"test": "node test", | |||
"bench": "node test --bench", | |||
"build": "uglifyjs lib/marked.js -cm --comments /Copyright/ -o marked.min.js" | |||
"build": "uglifyjs lib/marked.js -cm --comments /Copyright/ -o marked.min.js", | |||
"preversion": "npm run build" |
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.
I think it's best committing the minified file too
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.
This should be covered by the npm version
updating the package.json. Both files need to be committed at the same time.
- [ ] Fork `markedjs/marked` -> clone the library locally -> Make sure you are on the `master` branch | ||
- [ ] Create release branch from `master` (`release-##.##.##`) | ||
- `$ npm test` (run tests) | ||
- `$ npm version [major|minor|patch]` (updates `package.json` and creates `min` file) |
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.
possibly add info about committing too?
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.
I tried running the commit from package.json
and it didn't seem to work out. That's actually one of the things that led me to the preversion
thing. When we up the version, we have to commit the change to package.json
version, which included the changed min
file when I tested.
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.
Can you be more specific about what you did?
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.
Tried the npm run build && git commit -m 'minify' -- marked.min.js
Could have been something I messed up on my end. Having said that, if we decide to put the commit directly into the chain, might want to reconsider whether it should be part of preversion
. npm version
has to be run, therefore, package.json
will always be updated and need to be committed.
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.
To be clear, I'm a feel a little weird having the commit be automated - could just be me though.
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.
Maybe you had a npm test
set up somewhere along the command chain that failed and aborted everything.
Well I like the single commit (package.json + marked.min.js) idea.
Agreed on fixing the tests - like I say, it keeps crapping out whenever I run them from the script though...not sure if it's because of the failing test - can't remember if I removed it or not to test that theory; assuming that's what we're talking about here. :) Inspired mainly by: https://github.com/uswds/uswds/blob/develop/RELEASE.md |
Yes it's because of the failing test. The script exits 1 if any test failed. This branch solves that problem but I wanted to add some more tests to it before merging. |
- `$ npm test` (run tests) | ||
- `$ npm version [major|minor|patch]` (updates `package.json` and creates `min` file) | ||
- `$ npm publish` (publish to NPM) | ||
- [ ] Commit changes locally -> Submit PR to `origin/master` -> Merge PR |
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.
make clear to commit package.json and marked.min.js?
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.
See if the added lines cover it.
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.
yep
Some of the comments from @Feder1co5oave made me think we might benefit from a PR Template for the project...let me know if y'all think it is too much and I'll remove it from this PR. |
I was just thinking... do we really need to open a branch and then submit a PR and then merge it to master just to do a release? |
I like that flow. Forcing PRs gives an easy way to comment on changes and makes it easy to review changes. It makes it easier for multiple people to work on the same repo. +1 on the PR template. We could even have multiple PR templates for different types of PRs |
@Feder1co5oave: Re the branch + PR, I find it brings a consistency to operations - all code changes go through the same process. If I could figure out a way to make it so admins couldn't push, I probably would, to be honest. I like having everyone playing by the same rules...even admins. I shouldn't be able to bypass the review process just because I'm an admin. To your point, technically, no, we don't have to do all that to create a release. The GitHub release is a professional courtesy. Even committing the new version number to GitHub is optional, I think - could just run @UziTech: Didn't know multiple templates were a thing. Not sure they've figured out the UX on that score yet (having to update the URL seems odd); however, that could explain why they took submitting PRs out of GitHub Desktop. |
Y'all should be able to merge, if you agree with these changes...let me know if you can't. |
@joshbruce I'm specifically speaking about releasing, which does not bring code changes per se. I agree that any change to the code base should be reviewed before merging. |
Actually I still can't do anything... nothing changed from before the markedjs org |
@Feder1co5oave and @UziTech: Take a look this time. Upgraded both of you to have "write" permissions. Also, double check the "projects" tab to see if you can play with the task boards, please. |
@Feder1co5oave: Please try again and let me know. I've never used the PRs need review before merging option, wondering if that's what it was. |
Nope, still like the image above. That prevents merging non-reviewed PRs for everyone. The "authorized" link takes me here |
Thanks! Let's try again. Removed protected status for |
Also, here is the cheat sheet I'm working from: https://help.github.com/articles/repository-permission-levels-for-an-organization/ |
Alright, I see the Big Green Button! |
@Feder1co5oave: Right on! Having I'm going to try to protect master again. Will try to take it one step at a time. |
Understood! |
In theory:
|
Nope. |
It is grayed out for me |
I see grayed out button
|
From the git point of view merging a PR is equivalent to pushing to the branch, so you must enable it for us. I'm not sure about requiring status checks to pass. When we'll enable CI, the status will be clearly visibile right above the merge button so the reviewer can easily check its log but I personally wouldn't put a hard rule on it since it's not very well tested yet. |
On the other hand, requiring at least a positive review looks like a good compromise to me |
@Feder1co5oave: I hear ya. I think from the GitHub user-perspective (permissions), you need to have Turned off status checks for now...let me know what you get. (Sorry, too accustomed to working alone in organizations - odd as that may sound.) |
Somewhat unrelated question... should we be added to the markedjs org? Being part of the organization would give us a private discussion area so we wouldn't need to open prs or issues to discuss stuff. |
@UziTech: Invites sent. Can I also get a green button check? Only options I have set right now are to protect |
All right. Going to merge this one. Then I'm going to see what happens when I do the sequence to confirm things. |
Sorry I've been a little absent and did a sloppy review, but I feel I have a couple of problems with this proposal. The pull request template is a little confusing. First of all, all the checklist items regarding the release should not be there, but possibly in the RELEASE.md. They're confusing since they really have nothing to do with a PR that aims to solve some issue. About the release PR, the things that needs to be checked are:
So all in all, three things need to be checked regarding the release PR by the reviewer:
Whereas, in case of a contribution PR to solve some issue, I would treat it as if it were an "issue + patch" combination. So it either references some already submitted issue, or it presents the issue itself in the correct manner (expected/actual input/output samples):
Then, for the code change, I would prepare the following checklist:
I would leave listing the other fixed issues to us collaborators since that is quite tricky. So I guess these are my draft proposals for the issue and pull request templates, let me know! |
Publish sequence update
Description
preversion
instead of anything related t publish...version only update thepackage.json
file, which needs to be committed anyway; so, thinking anything that needs to be updated and part of a commit should be able to tag along.This gives us a three step process when we don't include the setup things - and makes us completely within NPM commands:
npm test
npm version [major|minor|patch]
npm publish
Replaces #1064
Review
Submitter
package.json
has been updated (see RELEASE.md).marked.min.js
has been updated; or,Reviewer
??