-
Notifications
You must be signed in to change notification settings - Fork 212
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
ci: properly handle subdependencies for Endo branch override #7958
Merged
Merged
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
#! /bin/bash | ||
# Usage: get-packed-versions.sh <WORKDIR> | ||
# | ||
# This script creates package tarballs in the specified workspace directory and | ||
# writes out information for resolve-versions.sh to update a destination | ||
# workspace to use them. This is useful for testing changes to dependencies of | ||
# the destination repository. | ||
set -xueo pipefail | ||
|
||
WORKDIR=${1:-.} | ||
cd -- "$WORKDIR" 1>&2 | ||
|
||
# Install and build the source directory. | ||
yarn install 1>&2 | ||
yarn build 1>&2 | ||
yarn --silent workspaces info | jq -r '.[].location' | while read -r dir; do | ||
# Skip private packages. | ||
echo "dir=$dir" 1>&2 | ||
test "$(jq .private < "$dir/package.json")" != true || continue | ||
|
||
################## | ||
pushd "$dir" 1>&2 | ||
|
||
# Gather the metadata. | ||
name=$(jq -r .name < package.json) | ||
version=$(jq -r .version < package.json) | ||
stem=$(echo "$name" | sed -e 's!^@!!; s!/!-!g;') | ||
file="$(pwd)/${stem}-v${version}.tgz" | ||
|
||
# Create the tarball. | ||
yarn pack 1>&2 | ||
|
||
# Write out the version entry. | ||
jq -s --arg name "$name" --arg file "$file" \ | ||
'{ key: $name, value: ("file:" + $file) }' < /dev/null | ||
|
||
popd 1>&2 | ||
################## | ||
done | jq -s from_entries |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
#!/bin/bash | ||
set -ueo pipefail | ||
|
||
# Accepts a dependency version map on stdin and updates the current | ||
# package.json's resolutions section to use the packages and versions from | ||
# the map. | ||
# This is useful for temporary bulk updates over all packages. | ||
|
||
DIR=$(dirname -- "${BASH_SOURCE[0]}") | ||
|
||
cd -- "$DIR/.." | ||
|
||
override=$(jq 'to_entries | map({ key: ("**/" + .key), value: .value }) | from_entries') | ||
|
||
PACKAGEJSONHASH=$( | ||
jq --arg override "$override" '.resolutions *= ($override | fromjson)' package.json | | ||
git hash-object -w --stdin | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Interesting hack There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I love this hack. It’s the best hack ever. |
||
) | ||
git cat-file blob "$PACKAGEJSONHASH" > package.json |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
Wondering if instead we shouldn't run a
yarn test --update-snapshots
(and ignore the clobbered snapshot artifacts in the porcelain check)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 don't want to make an assumption that this is the only SwingSet test using
t.snapshot
. This approach seems less brittle.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.
The way I see it, when we add a test that breaks under these endo changes, either we update the test, or we update the CI job to handle the test. The main problem is if there are golden test impacted by endo changes that do not use snapshots.
The CI config here could simply add
--update-snapshot
to allyarn test
invocations if we're not worried about other snapshot based tests diverging in more significant ways.