-
-
Notifications
You must be signed in to change notification settings - Fork 52
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
Parity with @npmcli/ci-detect #95
Conversation
One more thing I forgot to mention was that this repo doesn't have an String.includes is compatible from node 4 and up so I assume we're good to go here. |
Thanks @wraithgar . Changes looks good to me but I have one comment though on JENKINS.
Yeah. the engines field is missing, can be added. The package is simple and not concerned about node, but also didn't want to support very very old non maintained versions either. Plus, CI is never green on those due to devDependencies requirement on the engines, hence 8. But ignoring that it should cover most node versions than mentioned.
This is great. Awesome 🎉
👍
Yeah. Sometimes I miss them too 😅 . Will see if that could be automated. |
Based off of the work started in #34
Jenkins sometimes does not hav a JENKINS_URL, but does have a BUILD_ID. BUILD_ID is too generic to flag as Jenkins, but it is enough to flag as an anonymous CI.
Thank you both @sibiraj-s and @kanadgupta. I have amended this PR as per the very helpful feedback y'all gave, including adding an engines field. |
This is already the de facto engines standard because of CI
Thanks @wraithgar . Published in v3.6.0 🎉 |
{ | ||
"name": "Gerrit", | ||
"constant": "GERRIT", | ||
"env": "GERRIT_PROJECT" | ||
}, |
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.
Hello,
I am surprised to see Gerrit here. Does it have built-in CI support now? Cannot find anything mentioned at https://www.gerritcodereview.com/
Isn't GERRIT_PROJECT
rather used by the Gerrit Jenkins plugin(s)?
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.
That was always a distinction that @npmcli/ci-detect
made from the beginning. npm/ci-detect@8f14333
See watson/ci-info#95 for more context on achieving parity between these two modules. This changes npm to use `ci-info` instead of `@npmcli/ci-detect`. Everything that npm currently flags as a CI environment should still be doing so, so there is no breaking change there. There is going to be a subtle difference in the `ci-name` config, which nothing in npm currently looks at anyways, as well as the ci name that shows up in the default `user-agent` string. Some providers will be slightly different (i.e. circle-ci vs circleci and cirrus vs cirrus-ci)
See watson/ci-info#95 for more context on achieving parity between these two modules. This changes npm to use `ci-info` instead of `@npmcli/ci-detect`. Everything that npm currently flags as a CI environment should still be doing so, so there is no breaking change there. There is going to be a subtle difference in the `ci-name` config, which nothing in npm currently looks at anyways, as well as the ci name that shows up in the default `user-agent` string. Some providers will be slightly different (i.e. circle-ci vs circleci and cirrus vs cirrus-ci)
Follow up on the Vercel question, this is mostly for the npm folks tracking the move to this module. Question:
Answer:
As of now |
See watson/ci-info#95 for more context on achieving parity between these two modules. This changes npm to use `ci-info` instead of `@npmcli/ci-detect`. Everything that npm currently flags as a CI environment should still be doing so, so there is no breaking change there. There is going to be a subtle difference in the `ci-name` config, which nothing in npm currently looks at anyways, as well as the ci name that shows up in the default `user-agent` string. Some providers will be slightly different (i.e. circle-ci vs circleci and cirrus vs cirrus-ci)
Thanks again for everyone who helped w/ this. |
Greetings from the npm cli team. We recently had a bug filed in our own
ci detection library that
brought your library back to our attention. After doing some digging it
looks like possibly neither of our projects are doing things exactly the
same, and this PR is an attempt to get us in sync with the eventual goal
being to deprecate our library and start using yours.
In order for us to move to this library withouth it constituting a
semver major change in npm itself, we need to at the very least have
your library set
isPr
in the same environments that@npmcli/ci-detect
currently does. None of the other metadata reallymatters as far as npm itself is concerned.
This PR gets us MOST of the way via the following commits. I don't know
if you'd rather these all be separate PRs, or if you want the commits
squashed and the title to cover all the changes. Whatever works for you
works for us. Here are the changes present:
@npmcli/ci-detect
we check forVERCEL_URL
, and consideredNOW_BUILDER
to be the pre-aqcuisition "now" environment. Thisat least brings in the
VERCEL_URL
detection.@npmcli/ci-detect
currently also checks for Wercker, but that does notappear to be in use anymore so it was not included in this PR.
As far as the three vercel environments
vercel-bitbucket
,vercel-gitlab
, andvercel-github
, I have asked some folks at vercelif detecting
VERCEL_URL
is sufficient for knowing if one is generallyin any of those environments, if so
isCi
is going to be true still andthis will mean detection parity with
@npmcli/ci-detect
One final side-note. It doesn't appear that the
index.d.ts
file iscoupled in any way to
index.js
in tests. If I hadn't looked at otherPRs I wouldn't even have thought to update it along with new vendor
entries.
Looking forward to any feedback you have on this PR. We are pretty
excited about the idea of having one less module to maintain so we can
focus on package management and not ci detection.