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

Don't install gulp-cli globally in the GitHub Actions workflows #17913

Merged
merged 1 commit into from
Apr 11, 2024

Conversation

timvandermeij
Copy link
Contributor

@timvandermeij timvandermeij commented Apr 9, 2024

It's recommended to always install dependencies locally in the project folder because global dependencies can easily conflict with other projects and, because they are not managed by the project, diverge from versions defined in e.g. package.json. Previously we installed gulp-cli globally because at the time we lacked a convenient mechanism to use Gulp otherwise, but nowadays NPM provides the npx command for that purpose and recommends using it over global installations (see https://docs.npmjs.com/downloading-and-installing-packages-globally and PR #17489 that provided the ground work for using it).

This commit therefore updates our GitHub Actions workflows to no longer install gulp-cli globally but instead install it locally from the already existing entries in package.json like all other dependencies we use. Not only does this remove the special-casing for gulp-cli which simplifies the workflow definitions, it also ensures that the version ranges provided in package.json are respected. This makes the local and workflow setups more similar, but is also relevant for the upcoming upgrade to Gulp 5 which from a quick try is a bit involved and having package.json be the single source of truth for the dependency versions we use is therefore important.

Thanks to @nicolo-ribaudo for bringing this isolation measure to the attention!

It's recommended to always install dependencies locally in the project
folder because global dependencies can easily conflict with other
projects and, because they are not managed by the project, diverge from
versions defined in e.g. `package.json`. Previously we installed
`gulp-cli` globally because at the time we lacked a convenient mechanism
to use Gulp otherwise, but nowadays NPM provides the `npx` command for
that purpose and recommends using it over global installations (see
https://docs.npmjs.com/downloading-and-installing-packages-globally
and PR mozilla#17489 that provided the ground work for using it).

This commit therefore updates our GitHub Actions workflows to no longer
install `gulp-cli` globally but instead install it locally from the
already existing entries in `package.json` like all other dependencies
we use. Not only does this remove the special-casing for `gulp-cli`
which simplifies the workflow definitions, it also ensures that the
version ranges provided in `package.json` are respected. This makes the
local and workflow setups more similar, but is also relevant for the
upcoming upgrade to Gulp 5 which from a quick try is a bit involved and
having `package.json` be the single source of truth for the dependency
versions we use is therefore important.
Copy link
Collaborator

@Snuffleupagus Snuffleupagus left a comment

Choose a reason for hiding this comment

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

r=me, thanks.

@timvandermeij timvandermeij merged commit f4b5ec9 into mozilla:master Apr 11, 2024
9 checks passed
@timvandermeij timvandermeij deleted the gulp-github-actions branch April 11, 2024 10:26
timvandermeij added a commit to timvandermeij/botio-files-pdfjs that referenced this pull request May 31, 2024
…d one

The globally-installed version of Gulp on the bots is old, and recently
we moved away from using globally-installed dependencies in favor of
using locally-installed ones for maintainability, isolation and
reproducibility of build environments. For more information, refer to
PRs mozilla/pdf.js#17913 and
mozilla/pdf.js#17489.

In mozilla/pdf.js#18197 we have seen that even
though locally Gulp 5 is installed the global version is preferred by
the bots because the `gulp` command (available in the PATH) is used
instead of `npx gulp` which prefers the locally-installed version from
the `node_modules` folder.

This commit fixes the issue by making all Gulp invocations use `npx gulp`
instead, similar to what we already did in the GitHub Actions pipelines.
timvandermeij added a commit to timvandermeij/botio-files-pdfjs that referenced this pull request May 31, 2024
…d one

The globally-installed version of Gulp on the bots is old, and recently
we moved away from using globally-installed dependencies in favor of
using locally-installed ones for maintainability, isolation and
reproducibility of build environments. For more information, refer to
PRs mozilla/pdf.js#17913 and
mozilla/pdf.js#17489.

In mozilla/pdf.js#18197 we have seen that even
though locally Gulp 5 is installed the global version is preferred by
the bots because the `gulp` command (available in the PATH) is used
instead of `npx gulp` which prefers the locally-installed version from
the `node_modules` folder.

This commit fixes the issue by making all Gulp invocations use `npx gulp`
instead, similar to what we already did in the GitHub Actions pipelines.
timvandermeij added a commit to timvandermeij/pdf.js that referenced this pull request Nov 17, 2024
In PR mozilla#11300 Gitpod support got introduced, but we re-evaluated that
decision in mozilla#11732. In PR mozilla#11800 the support was partially reverted,
but the actual Gitpod files were kept to not outright break potential
workflows because at the time we were not sure if, and if so how often,
Gitpod was actually used for contributing to PDF.js.

However, in addition to the concerns mentioned in mozilla#11732 after five
years we haven't seen any contributions that clearly originated from
Gitpod, and the Dockerfile has not been updated after e.g. PR mozilla#11807
and PR mozilla#17913 because it's not a workflow that we maintain or are able
to test (nor have we seen Gitpod community contributions for this).

This commit therefore removes the remaining Gitpod files too to reduce
maintainance burden for PDF.js. Note that users of Gitpod can still
contribute to PDF.js via the platform; we just don't provide/manage
workspace files from this repository anymore.
timvandermeij added a commit to timvandermeij/pdf.js that referenced this pull request Nov 17, 2024
In PR mozilla#11300 Gitpod support got introduced, but we re-evaluated that
decision in mozilla#11732. In PR mozilla#11800 the support was partially reverted,
but the actual Gitpod files were kept to not outright break potential
workflows because at the time we were not sure if, and if so how often,
Gitpod was actually used for contributing to PDF.js.

However, in addition to the concerns mentioned in mozilla#11732 after five
years we haven't seen any contributions that clearly originated from
Gitpod, and the files have not been updated after e.g. PR mozilla#11807 and
PR mozilla#17913 because it's not a workflow that we maintain or are able
to test (nor have we seen Gitpod community contributions for this).

This commit therefore removes the remaining Gitpod files to reduce
maintainance burden for PDF.js. Note that users of Gitpod can still
contribute to PDF.js via the platform; we just don't provide/manage
workspace files from this repository anymore.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants