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

build: add conflict marker check on release #7625

Merged
merged 1 commit into from
Jul 20, 2016

Conversation

mscdex
Copy link
Contributor

@mscdex mscdex commented Jul 8, 2016

Checklist
  • make -j4 test (UNIX), or vcbuild test nosign (Windows) passes
  • commit message follows commit guidelines
Affected core subsystem(s)
  • build
Description of change

This change to the release process helps find conflict markers in files so that they don't make it into a release.

@mscdex mscdex added the build Issues and PRs related to build files or the CI. label Jul 8, 2016
@mscdex mscdex force-pushed the build-conflict-marker-check branch from 0f4008d to 259d54c Compare July 8, 2016 23:29
@mscdex
Copy link
Contributor Author

mscdex commented Jul 8, 2016

/cc @nodejs/release

@evanlucas
Copy link
Contributor

should this also include an update to doc/releases.md?

@mscdex
Copy link
Contributor Author

mscdex commented Jul 8, 2016

@evanlucas Not that I'm aware of? I mean, it wouldn't hurt, but this automatic check should work too.

@@ -463,6 +463,12 @@ release-only:
echo 'Please update Added: tags in the documentation first.' ; \
exit 1 ; \
fi
@if $(grep -IPqrs '^>>>>>>> [0-9A-Fa-f]+' benchmark deps doc lib src test tools) || \
Copy link
Member

Choose a reason for hiding this comment

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

I'd also check for ^<<<<<<< (but not ^======= because that's going to match a gazillion section markers in documentation.)

Copy link
Contributor Author

@mscdex mscdex Jul 9, 2016

Choose a reason for hiding this comment

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

Why both? Wouldn't the current regexp match all instances anyway?

Copy link
Member

@bnoordhuis bnoordhuis Jul 9, 2016

Choose a reason for hiding this comment

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

Would it? I'm thinking of situations where someone removes some of the conflict markers after manual resolution but not everything.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

If that's the case, it's possible they could leave the ======= behind too and we wouldn't have an easy way of checking for that.

Copy link
Member

Choose a reason for hiding this comment

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

Right. We'd need three checks if we wanted to be really thorough but the third one isn't practical. It's not perfect but two checks is still better than one.

@Fishrock123
Copy link
Contributor

Should this be run as a git pre-commit check?

@Fishrock123
Copy link
Contributor

(Or on the regular CI?)

@mscdex
Copy link
Contributor Author

mscdex commented Jul 9, 2016

@Fishrock123 I dunno, I just decided to put it on pre-release since it may take some time to scan all the files and someone leaving conflict markers does not happen often. shrug

@cjihrig
Copy link
Contributor

cjihrig commented Jul 9, 2016

I think making this part of the CI would be good. I don't think it should hold up a release, or be on the release manager to resolve while trying to get a release out the door. If it might take a while to execute, would it be possible to include the check in the CI lint job, and not make it run on local machines?

@mscdex mscdex force-pushed the build-conflict-marker-check branch from 259d54c to 3d681dd Compare July 9, 2016 20:48
@mscdex
Copy link
Contributor Author

mscdex commented Jul 9, 2016

@cjihrig You could probably say the same thing about holding up a release because "REPLACEME" was found in API docs (which is currently the case). I don't really have a strong opinion about when it happens, so long as we can ensure it gets caught early enough without noticeably impacting normal operations.

I've moved it to the lint-ci target now.

@mscdex mscdex force-pushed the build-conflict-marker-check branch from 3d681dd to bc3708d Compare July 12, 2016 02:09
@mscdex
Copy link
Contributor Author

mscdex commented Jul 12, 2016

@bnoordhuis Added a check for the beginning marker

@mscdex mscdex force-pushed the build-conflict-marker-check branch from bc3708d to 8655b94 Compare July 12, 2016 02:10
@rvagg
Copy link
Member

rvagg commented Jul 12, 2016

@mscdex mscdex force-pushed the build-conflict-marker-check branch from 8655b94 to 52e5594 Compare July 12, 2016 06:22
@mscdex
Copy link
Contributor Author

mscdex commented Jul 12, 2016

I tweaked the grep args, apparently (Free)BSD does not support the Perl regexps option, but the Extended regexps option works just as well.

CI again: https://ci.nodejs.org/job/node-test-pull-request/3262/
Example conflict marker detection currently on v6.x: https://ci.nodejs.org/job/node-test-linter/3269/console

lint-ci: jslint-ci cpplint
@if [ "$(shell grep -IEqrs "$(CONFLICT_RE)" benchmark deps doc lib src test tools > /dev/null 2>&1; echo $$?)" != "0" \
Copy link
Member

Choose a reason for hiding this comment

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

Can't this be simplified to if ! ( grep -EIqrs ... ) && ! ( find . -maxdepth 1 ... ); then? You could swap the clauses, replace && with || and drop the negation to shorten it even more.

You probably don't need to redirect stdio either if you are suppressing errors with -s.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Changed.

@Fishrock123
Copy link
Contributor

lgtm as a first step

@mscdex mscdex force-pushed the build-conflict-marker-check branch from 52e5594 to be0062f Compare July 12, 2016 14:40
@mscdex
Copy link
Contributor Author

mscdex commented Jul 12, 2016

CI again after changes to conditional: https://ci.nodejs.org/job/node-test-pull-request/3268/
Example conflict marker detection currently on v6.x: https://ci.nodejs.org/job/node-test-linter/3278/console

@bnoordhuis
Copy link
Member

LGTM

PR-URL: nodejs#7625
Reviewed-By: Rod Vagg <rod@vagg.org>
Reviewed-By: Jeremiah Senkpiel <fishrock123@rocketmail.com>
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
@mscdex mscdex force-pushed the build-conflict-marker-check branch from be0062f to 68b966b Compare July 20, 2016 23:07
@mscdex
Copy link
Contributor Author

mscdex commented Jul 20, 2016

One last CI before merging: https://ci.nodejs.org/job/node-test-pull-request/3357/

@mscdex mscdex merged commit 68b966b into nodejs:master Jul 20, 2016
@mscdex mscdex deleted the build-conflict-marker-check branch July 20, 2016 23:44
evanlucas pushed a commit that referenced this pull request Jul 21, 2016
PR-URL: #7625
Reviewed-By: Rod Vagg <rod@vagg.org>
Reviewed-By: Jeremiah Senkpiel <fishrock123@rocketmail.com>
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
@MylesBorins
Copy link
Contributor

@mscdex should we backport to v4.x?

MylesBorins pushed a commit that referenced this pull request Oct 10, 2016
PR-URL: #7625
Reviewed-By: Rod Vagg <rod@vagg.org>
Reviewed-By: Jeremiah Senkpiel <fishrock123@rocketmail.com>
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
@MylesBorins
Copy link
Contributor

MylesBorins commented Oct 10, 2016

just finished backporting... the job found some markers that shouldn't have been there and has already saved v4.x from some pain

<3 @mscdex

MylesBorins pushed a commit that referenced this pull request Oct 10, 2016
PR-URL: #7625
Reviewed-By: Rod Vagg <rod@vagg.org>
Reviewed-By: Jeremiah Senkpiel <fishrock123@rocketmail.com>
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
rvagg pushed a commit that referenced this pull request Oct 18, 2016
PR-URL: #7625
Reviewed-By: Rod Vagg <rod@vagg.org>
Reviewed-By: Jeremiah Senkpiel <fishrock123@rocketmail.com>
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
MylesBorins pushed a commit that referenced this pull request Oct 26, 2016
PR-URL: #7625
Reviewed-By: Rod Vagg <rod@vagg.org>
Reviewed-By: Jeremiah Senkpiel <fishrock123@rocketmail.com>
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
@MylesBorins MylesBorins mentioned this pull request Oct 26, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
build Issues and PRs related to build files or the CI.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants