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

Sync with upstream v205 #71

Merged
merged 50 commits into from
Mar 22, 2023
Merged
Show file tree
Hide file tree
Changes from 46 commits
Commits
Show all changes
50 commits
Select commit Hold shift + click to select a range
123baaa
Enable devDependency pruning for Yarn 2
colincasey May 18, 2022
3d058ee
Enable devDependency pruning for Yarn 2
colincasey May 18, 2022
3b6a939
Update CHANGELOG.md
colincasey May 19, 2022
c497cb2
Update CHANGELOG.md
colincasey May 26, 2022
e496d9c
Merge pull request #1001 from heroku/ccasey/fully_enable_yarn2_pruning
colincasey May 26, 2022
91e821f
Add Heroku-22 to the CI test matrix (#1003)
edmorley May 26, 2022
d53f03e
Add Node.js 17 and 18 support (#1002)
joshwlewis May 26, 2022
590ed15
Update CHANGELOG.md before publishing v196
colincasey May 31, 2022
da8c7ef
Fixed broken link in README.md
colincasey May 31, 2022
b71e33b
Merge pull request #1005 from heroku/ccasey/changelog_v196
colincasey May 31, 2022
cac568e
Drop yarn-native-cache feature (#1004)
joshwlewis Jun 1, 2022
34b2aad
Fix for skipping pruning with Yarn 2 (#1008)
colincasey Jun 3, 2022
5917461
Fix for npm ci caching (#1009)
colincasey Jun 3, 2022
a64a260
Update CHANGELOG.md for v197 release (#1012)
colincasey Jun 7, 2022
b008ed3
Bump github.com/stretchr/testify from 1.7.1 to 1.7.2 (#1011)
dependabot[bot] Jun 9, 2022
b882fc4
Switch away from deprecated path-based S3 URLs (#1013)
edmorley Jun 13, 2022
fb8a1b7
Remove optional `jq` install step (#1016)
edmorley Jun 13, 2022
7881511
Adjust curl retry and connection timeout handling (#1017)
edmorley Jun 13, 2022
99d84a8
Release v198 (#1018)
edmorley Jun 15, 2022
5b8a09d
Bump got from 11.8.3 to 11.8.5 in /yarn2-plugins/prune-dev-dependenci…
dependabot[bot] Sep 6, 2022
6c81817
Update Node.js inventory (#1034)
joshwlewis Sep 26, 2022
6504bba
Support GitHub Actions in etc scripts (#1033)
joshwlewis Sep 26, 2022
33bdd8b
Bump rspec-expectations from 3.11.0 to 3.11.1 (#1031)
dependabot[bot] Sep 29, 2022
2db2647
Remove dependency on semver.herokuapp.com (#1037)
edmorley Oct 3, 2022
688a25e
Release v199 (#1038)
edmorley Oct 3, 2022
39eba31
Convert heroku/heroku-buildpack-nodejs to GitHub Actions (#1036)
mgomes Oct 11, 2022
776cb06
Dependency pruning support for Yarn 2, 3, and 4 (#1040)
colincasey Oct 18, 2022
aacce02
Reduce Dependabot frequency to monthly (#1042)
edmorley Oct 19, 2022
e2488d6
Release of #1040 (#1044)
colincasey Oct 19, 2022
ef0ed63
Change the default Node.js to 18.x (#1045)
joshwlewis Oct 19, 2022
75e9081
Add support for Node 19 (#1046)
joshwlewis Oct 19, 2022
95daf18
Prepare v201 (#1047)
joshwlewis Oct 19, 2022
3b91e2f
Update to go 1.19 and recompile (#1050)
joshwlewis Nov 3, 2022
9a0fa64
Bump github.com/stretchr/testify from 1.7.2 to 1.8.1 (#1049)
dependabot[bot] Nov 10, 2022
221ed07
Bump rspec-expectations from 3.11.1 to 3.12.0 (#1048)
dependabot[bot] Nov 10, 2022
b16e5b8
Allow yarn version selection for yarn berry projects (#1060)
joshwlewis Feb 10, 2023
e4452dd
Bump heroku_hatchet from 7.3.4 to 8.0.1 (#1062)
dependabot[bot] Mar 2, 2023
3ee6bf4
Add a scheduled Hatchet app cleaner workflow (#1065)
edmorley Mar 2, 2023
d3a9fc5
Use inventory-based version resolver from heroku/nodejs CNB (#1061)
joshwlewis Mar 3, 2023
e833305
Bump json5 from 2.2.1 to 2.2.3 in /yarn2-plugins/prune-dev-dependenci…
dependabot[bot] Mar 3, 2023
042015e
Bump http-cache-semantics in /yarn2-plugins/prune-dev-dependencies (#…
dependabot[bot] Mar 3, 2023
b496d60
Bump rspec-expectations from 3.12.0 to 3.12.2 (#1057)
dependabot[bot] Mar 3, 2023
7485da8
Simplify version resolver make target (#1067)
joshwlewis Mar 3, 2023
e249859
Add node 18.15.0 and yarn 4.0.0-rc.40 to inventory (#1069)
colincasey Mar 9, 2023
ef9d7a4
Release v205 (#1070)
colincasey Mar 13, 2023
fc761fe
Merge branch 'main' of github.com:heroku/heroku-buildpack-nodejs into…
ipfaze Mar 21, 2023
862aa59
style(script): adapt message to scalingo
ipfaze Mar 21, 2023
34f01ac
test(ci): remove tests from heroku
ipfaze Mar 21, 2023
e5ae4f1
fix(lib): also check against heroku stack
Mar 21, 2023
72a26c1
style(lib): fix typo
Mar 21, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
68 changes: 0 additions & 68 deletions .circleci/config.yml

This file was deleted.

58 changes: 58 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
name: CI

on:
push:
branches: ["main"]
pull_request:

permissions:
contents: read

jobs:

unit-test:
runs-on: ubuntu-22.04
container:
image: heroku/heroku:${{ matrix.stack_number }}-build
strategy:
matrix:
stack_number: ["18", "20", "22"]
env:
STACK: heroku-${{ matrix.stack_number }}
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Unit tests on heroku:${{ matrix.stack_number }}-build
run: test/unit

functional-test:
runs-on: ubuntu-22.04
container:
image: heroku/heroku:${{ matrix.stack_number }}-build
strategy:
matrix:
stack_number: ["18", "20", "22"]
env:
STACK: heroku-${{ matrix.stack_number }}
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Functional tests on heroku:${{ matrix.stack_number }}-build
run: test/run

hatchet-test:
runs-on: ubuntu-22.04
env:
HEROKU_API_KEY: ${{ secrets.HEROKU_API_KEY }}
HEROKU_API_USER: ${{ secrets.HEROKU_API_USER }}
HATCHET_EXPENSIVE_MODE: "1"
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Install Ruby and gems
uses: ruby/setup-ruby@v1
with:
ruby-version: '2.7'
bundler-cache: true
- name: Run hatchet tests
run: make hatchet
31 changes: 31 additions & 0 deletions .github/workflows/hatchet_app_cleaner.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
name: Hatchet app cleaner

on:
schedule:
# Daily at 6am UTC.
- cron: "0 6 * * *"
# Allow the workflow to be manually triggered too.
workflow_dispatch:

permissions:
contents: read

jobs:
hatchet-app-cleaner:
runs-on: ubuntu-latest
env:
HEROKU_API_KEY: ${{ secrets.HEROKU_API_KEY }}
HEROKU_API_USER: ${{ secrets.HEROKU_API_USER }}
HEROKU_DISABLE_AUTOUPDATE: 1
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Install Ruby and dependencies
uses: ruby/setup-ruby@v1
with:
bundler-cache: true
ruby-version: "2.7"
- name: Run Hatchet destroy
# Only apps older than 10 minutes are destroyed, to ensure that any
# in progress CI runs are not interrupted.
run: bundle exec hatchet destroy --older-than 10
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,4 @@
.DS_Store
repos/*
.idea
.build
49 changes: 48 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,54 @@

## main

## v195 (2022-04-12)
## v205 (2023-03-13)

- Added node version 18.15.0
- Added yarn version 4.0.0-rc.40

## v204 (2023-03-03)

- Switch to inventory-based Node.js and Yarn version resolver ([#1061](https://github.com/heroku/heroku-buildpack-nodejs/pull/1061))

## v203 (2023-02-10)

- Allow yarn version selection for yarn berry projects ([#1060](https://github.com/heroku/heroku-buildpack-nodejs/pull/1060))

## v202 (2022-11-03)

- Update go to 1.19 and recompile resolve-version ([#1050](https://github.com/heroku/heroku-buildpack-nodejs/pull/1050))

## v201 (2022-10-19)

- Add metrics and tests for Node.js 19.x line ([#1046](https://github.com/heroku/heroku-buildpack-nodejs/pull/1046))
- Update default node version to 18.x for heroku-20 and newer ([#1045](https://github.com/heroku/heroku-buildpack-nodejs/pull/1045))

## v200 (2022-10-19)

- Dependency pruning support for Yarn 2 / 3 / 4 ([#1040](https://github.com/heroku/heroku-buildpack-nodejs/pull/1040))

## v199 (2022-10-03)

- Remove dependency on semver.herokuapp.com ([#1037](https://github.com/heroku/heroku-buildpack-nodejs/pull/1037))

## v198 (2022-06-15)

- Adjust curl retry and connection timeout handling ([#1017](https://github.com/heroku/heroku-buildpack-nodejs/pull/1017))
- `jq` is no longer installed by the buildpack([#1016](https://github.com/heroku/heroku-buildpack-nodejs/pull/1016))
- Switch away from deprecated path-based S3 URLs ([#1013](https://github.com/heroku/heroku-buildpack-nodejs/pull/1013))

## v197 (2022-06-07)
- Drop the `yarn-native-cache` feature flag ([#1004](https://github.com/heroku/heroku-buildpack-nodejs/pull/1004))
- Fix for `npm ci` caching ([#1009](https://github.com/heroku/heroku-buildpack-nodejs/pull/1009))
- Fix skip pruning behavior with Yarn 2 ([#1008](https://github.com/heroku/heroku-buildpack-nodejs/pull/1008))

## v196 (2022-05-31)
- Add metrics plugin for Node 17 and 18 ([#1002](https://github.com/heroku/heroku-buildpack-nodejs/pull/1002))
- Add warning message for Node 18+ incompatibility with heroku-18 ([#1002](https://github.com/heroku/heroku-buildpack-nodejs/pull/1002))
- Enable Yarn 2 `devDependency` pruning using a custom plugin for all customers ([#1001](https://github.com/heroku/heroku-buildpack-nodejs/pull/1001))
- Test against Heroku-22 ([#1003](https://github.com/heroku/heroku-buildpack-nodejs/pull/1003))

## v195 (2022-04-13)
- Enable Yarn 2 `devDependency` pruning using a custom plugin for 20% of customers ([#999](https://github.com/heroku/heroku-buildpack-nodejs/pull/999))
- Set xtrace mode in buildpack when BUILDPACK_XTRACE environment variable is set ([#925](https://github.com/heroku/heroku-buildpack-nodejs/pull/925))

Expand Down
2 changes: 1 addition & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ There are unit tests that are run with `shunit`. For any change you make, write

### Running Tests

To run the tests, run `make test`. You will need Docker installed. This will start a test run of all 3 Heroku stack images that will run serially. If you want to test one stack image (which is usually adequate), run `make heroku-20` (or whatever stack image you'd like to test).
To run the tests, run `make test`. You will need Docker installed. This will start a test run of all 3 Heroku stack images that will run serially. If you want to test one stack image (which is usually adequate), run `make heroku-22` (or whatever stack image you'd like to test).

## Opening a Pull Request

Expand Down
20 changes: 10 additions & 10 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,14 @@ GEM
specs:
diff-lcs (1.5.0)
erubis (2.7.0)
excon (0.86.0)
excon (0.99.0)
heroics (0.1.2)
erubis (~> 2.0)
excon
moneta
multi_json (>= 1.9.2)
webrick
heroku_hatchet (7.3.4)
heroku_hatchet (8.0.1)
excon (~> 0)
platform-api (~> 3)
rrrretry (~> 1)
Expand All @@ -22,25 +22,25 @@ GEM
parallel_split_test (0.10.0)
parallel (>= 0.5.13)
rspec-core (>= 3.9.0)
platform-api (3.3.0)
platform-api (3.5.0)
heroics (~> 0.1.1)
moneta (~> 1.0.0)
rate_throttle_client (~> 0.1.0)
rake (13.0.6)
rate_throttle_client (0.1.2)
rrrretry (1.0.0)
rspec-core (3.11.0)
rspec-support (~> 3.11.0)
rspec-expectations (3.11.0)
rspec-core (3.12.0)
rspec-support (~> 3.12.0)
rspec-expectations (3.12.2)
diff-lcs (>= 1.2.0, < 2.0)
rspec-support (~> 3.11.0)
rspec-support (~> 3.12.0)
rspec-retry (0.6.2)
rspec-core (> 3.3)
rspec-support (3.11.0)
rspec-support (3.12.0)
sem_version (2.0.1)
thor (1.1.0)
thor (1.2.1)
threaded (0.0.4)
webrick (1.7.0)
webrick (1.8.1)

PLATFORMS
ruby
Expand Down
19 changes: 11 additions & 8 deletions bin/compile
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,7 @@ build_start_time=$(nowms)
handle_failure() {
meta_set "node-build-success" "false"
header "Build failed"
fail_using_yarn2_with_yarn_production_environment_variable_set "$LOG_FILE"
fail_yarn_outdated "$LOG_FILE"
fail_yarn_lockfile_outdated "$LOG_FILE"
fail_node_install "$LOG_FILE" "$BUILD_DIR"
Expand Down Expand Up @@ -204,12 +205,6 @@ fi
[ ! "$NPM_CONFIG_CACHE" ] && NPM_CONFIG_CACHE=$(mktemp -d -t npmcache.XXXXX)
export YARN_CACHE_FOLDER NPM_CONFIG_CACHE

[[ $(features_get "cache-native-yarn-cache") == "false" ]] && USE_YARN_CACHE=false

if [[ -z "$USE_NPM_INSTALL" ]] && [[ $(features_get_with_blank "use-npm-ci") == "false" ]]; then
USE_NPM_INSTALL=true
fi

install_bins() {
local node_engine npm_engine yarn_engine npm_version node_version

Expand Down Expand Up @@ -276,6 +271,14 @@ install_bins() {
header "Installing binaries" | output "$LOG_FILE"
install_bins | output "$LOG_FILE"

if [[ -z "$USE_NPM_INSTALL" ]]; then
if [[ "$(should_use_npm_ci "$BUILD_DIR")" == "true" ]]; then
USE_NPM_INSTALL=false
else
USE_NPM_INSTALL=true
fi
fi

restore_cache() {
local cache_status cache_directories restore_cache_start_time
restore_cache_start_time=$(nowms)
Expand All @@ -298,7 +301,7 @@ restore_cache() {
elif [[ "$cache_status" == "valid" ]]; then
header "Restoring cache"
if [[ "$cache_directories" == "" ]]; then
restore_default_cache_directories "$BUILD_DIR" "$CACHE_DIR" "$YARN_CACHE_FOLDER"
restore_default_cache_directories "$BUILD_DIR" "$CACHE_DIR" "$YARN_CACHE_FOLDER" "$NPM_CONFIG_CACHE"
else
restore_custom_cache_directories "$BUILD_DIR" "$CACHE_DIR" "$cache_directories"
fi
Expand Down Expand Up @@ -369,7 +372,7 @@ cache_build() {
:
elif [[ "$cache_directories" == "" ]]; then
header "Caching build"
save_default_cache_directories "$BUILD_DIR" "$CACHE_DIR" "$YARN_CACHE_FOLDER"
save_default_cache_directories "$BUILD_DIR" "$CACHE_DIR" "$YARN_CACHE_FOLDER" "$NPM_CONFIG_CACHE"
else
header "Caching build"
save_custom_cache_directories "$BUILD_DIR" "$CACHE_DIR" "$cache_directories"
Expand Down
4 changes: 0 additions & 4 deletions bin/report
Original file line number Diff line number Diff line change
Expand Up @@ -147,12 +147,8 @@ kv_pair "yarn_prune_time" "$(meta_get "yarn-prune-time")"
kv_pair "yarn_prune_memory" "$(meta_get "yarn-prune-memory")"

# testing resolve-version differences
kv_pair "resolve_v1_node" "$(meta_get "resolve-v1-node")"
kv_pair "resolve_v1_yarn" "$(meta_get "resolve-v1-yarn")"
kv_pair "resolve_v2_node" "$(meta_get "resolve-v2-node")"
kv_pair "resolve_v2_yarn" "$(meta_get "resolve-v2-yarn")"
kv_pair "resolve_is_equal_node" "$(meta_get "resolve-is-equal-node")"
kv_pair "resolve_is_equal_yarn" "$(meta_get "resolve-is-equal-yarn")"
kv_pair_string "resolve_v2_error" "$(meta_get "resolve-v2-error")"

# save which features were turned on or off
Expand Down
23 changes: 21 additions & 2 deletions buildpack.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,29 @@ name = "Node.js"

[publish.Ignore]
files = [
".circle/",
".circleci/",
".github/",
".git2gus/",
"etc/",
"spec/",
"test/",
"makefile"
"makefile",
"Gemfile.lock",
"Gemfile",
"hatchet.json",
"go.mod",
"go.sum",
"hatchet.lock",
"cmd/",
# TODO: get rid of these ignores once the yarn plugins are moved into a separate repo
# for now we just need the compiled plugin in yarn2-plugin/prune-dev-dependencies/bundles
"yarn2-plugins/prune-dev-dependencies/.editorconfig",
"yarn2-plugins/prune-dev-dependencies/package-lock.json",
"yarn2-plugins/prune-dev-dependencies/.gitignore",
"yarn2-plugins/prune-dev-dependencies/package.json",
"yarn2-plugins/prune-dev-dependencies/tsconfig.json",
"yarn2-plugins/prune-dev-dependencies/README.md",
"yarn2-plugins/prune-dev-dependencies/tests",
"yarn2-plugins/prune-dev-dependencies/jest.config.js",
"yarn2-plugins/prune-dev-dependencies/src",
]
Loading