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

ci(local-npm): resume integration testing of NPM canary #7883

Merged
merged 5 commits into from
Jun 6, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
21 changes: 15 additions & 6 deletions .github/workflows/integration.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,7 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
# FIXME: Use this to enable NPM deploys...
# cli: [link-cli, local-npm]
cli: [link-cli]
cli: [link-cli, local-npm]
steps:
- uses: actions/checkout@v3
with:
Expand Down Expand Up @@ -89,6 +87,8 @@ jobs:
if: ${{ matrix.cli == 'local-npm' }}
run: |
tmp_registry_log=`mktemp`
dist_tag=agblah

nohup npx verdaccio@^5.4.0 &>$tmp_registry_log &
# Wait for `verdaccio` to boot
grep -q 'http address' <(tail -f $tmp_registry_log)
Expand All @@ -103,14 +103,23 @@ jobs:

npm whoami

# Publish the packages to our local service.
yarn lerna publish --conventional-prerelease --canary --exact \
--dist-tag=blah --preid=dev-$(git rev-parse --short=7 HEAD) \
--dist-tag=$dist_tag --preid=dev-$(git rev-parse --short=7 HEAD) \
--no-push --no-verify-access --yes

yarn global add agoric@blah </dev/null
# Git dirty check.
if [[ -n "$(git status --porcelain)" ]]; then
echo "Git status is dirty, aborting."
git status
exit 1
fi

# Install the Agoric CLI on this machine's $PATH.
yarn global add agoric@$dist_tag </dev/null

# Use the locally-installed dist-tag.
echo 'AGORIC_INSTALL_OPTIONS=["blah"]' >> $GITHUB_ENV
echo "AGORIC_INSTALL_OPTIONS=[\"$dist_tag\"]" >> $GITHUB_ENV
echo 'AGORIC_START_OPTIONS=["--rebuild"]' >> $GITHUB_ENV
echo 'AGORIC_CMD=["agoric"]' >> $GITHUB_ENV

Expand Down
15 changes: 0 additions & 15 deletions .github/workflows/test-all-packages.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,21 +37,6 @@ jobs:
with:
node-version: ${{ matrix.node-version }}

##################
# NPM pack tests
# Check that all the packages can be packed to publish
npm-pack:
needs: build
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: ./.github/actions/restore-node
with:
node-version: '18.x'

- name: npm pack
run: yarn lerna exec yarn pack

Comment on lines -40 to -54
Copy link
Member Author

Choose a reason for hiding this comment

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

This doesn't actually exercise the same process as lerna publish, so I'm disabling it in favour of the integration test.

Copy link
Member

Choose a reason for hiding this comment

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

thanks for the explanation

##################
# Lint tests
# We run per package bc of https://github.com/typescript-eslint/typescript-eslint/issues/1192
Expand Down
2 changes: 1 addition & 1 deletion packages/SwingSet/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@
"@endo/marshal": "^0.8.5",
"@endo/nat": "^4.1.27",
"@endo/promise-kit": "^0.2.56",
"@endo/ses-ava": "^0.2.40",
"@endo/zip": "^0.2.31",
"ansi-styles": "^6.2.1",
"anylogger": "^0.21.0",
Expand All @@ -59,7 +60,6 @@
"tmp": "^0.2.1"
},
"peerDependencies": {
michaelfig marked this conversation as resolved.
Show resolved Hide resolved
"@endo/ses-ava": "^0.2.40",
"ava": "^5.2.0"
},
"files": [
Expand Down
3 changes: 2 additions & 1 deletion packages/cosmic-swingset/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,8 @@
"@endo/nat": "^4.1.27",
"@endo/promise-kit": "^0.2.56",
"@iarna/toml": "^2.2.3",
"@opentelemetry/sdk-metrics": "^0.32.0",
"@opentelemetry/sdk-metrics": "~1.9.0",
"@opentelemetry/api": "~1.3.0",
"anylogger": "^0.21.0",
"deterministic-json": "^1.0.5",
"import-meta-resolve": "^2.2.1",
Expand Down
12 changes: 6 additions & 6 deletions packages/cosmic-swingset/src/kernel-stats.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@ import {

// diag.setLogger(new DiagConsoleLogger(), DiagLogLevel.VERBOSE);

/** @typedef {import('@opentelemetry/api-metrics').MetricAttributes} Attributes */
/** @typedef {import('@opentelemetry/api-metrics').Histogram} Histogram */
/** @typedef {import('@opentelemetry/api').MetricAttributes} Attributes */
/** @typedef {import('@opentelemetry/api').Histogram} Histogram */

import { getTelemetryProviders as getTelemetryProvidersOriginal } from '@agoric/telemetry';

Expand Down Expand Up @@ -111,7 +111,7 @@ export function getTelemetryProviders(powers = {}) {
}

/**
* @param {import('@opentelemetry/api-metrics').Meter} metricMeter
* @param {import('@opentelemetry/api').Meter} metricMeter
* @param {string} name
*/
function createHistogram(metricMeter, name) {
Expand All @@ -121,8 +121,8 @@ function createHistogram(metricMeter, name) {

/**
* @param {{
* metricMeter: import('@opentelemetry/api-metrics').Meter,
* attributes?: import('@opentelemetry/api-metrics').MetricAttributes,
* metricMeter: import('@opentelemetry/api').Meter,
* attributes?: import('@opentelemetry/api').MetricAttributes,
* }} param0
*/
export function makeSlogCallbacks({ metricMeter, attributes = {} }) {
Expand Down Expand Up @@ -284,7 +284,7 @@ export function makeInboundQueueMetrics(initialLength) {
/**
* @param {object} param0
* @param {any} param0.controller
* @param {import('@opentelemetry/api-metrics').Meter} param0.metricMeter
* @param {import('@opentelemetry/api').Meter} param0.metricMeter
Copy link
Member

Choose a reason for hiding this comment

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

this commit is titled "fix(cosmic-swingset): adapt to new @opentelemetry". For the changelog, there is nothing to fix. This is really a fixup to the change that bumped the OpenTelemetry version. Better to squash it into that commit. Even better is isolating the opentelemetry changes (deps and code) from the other commits.

* @param {Console} param0.log
* @param {Attributes} [param0.attributes]
* @param {any} [param0.inboundQueueMetrics]
Expand Down
9 changes: 7 additions & 2 deletions packages/deploy-script-support/src/extract-proposal.js
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,11 @@ const pathResolve = (...paths) => {
}
};

const findModule = (initDir, srcSpec) =>
srcSpec.match(/^(\.\.?)?\//)
? pathResolve(initDir, srcSpec)
: req.resolve(srcSpec);

/**
* Format core proposals to be run at bootstrap:
* SwingSet `bundles` configuration
Expand Down Expand Up @@ -99,12 +104,12 @@ export const extractCoreProposalBundles = async (
const thisProposalBundleHandles = new Set();
assert(getSequenceForProposal);
const thisProposalSequence = getSequenceForProposal(i);
const initPath = pathResolve(dirname, module);
const initPath = findModule(dirname, module);
const initDir = path.dirname(initPath);
/** @type {Record<string, import('./externalTypes.js').ProposalBuilder>} */
const ns = await import(initPath);
const install = (srcSpec, bundlePath) => {
const absoluteSrc = pathResolve(initDir, srcSpec);
const absoluteSrc = findModule(initDir, srcSpec);
const bundleHandle = {};
const absolutePaths = { source: absoluteSrc };
if (bundlePath) {
Expand Down
8 changes: 2 additions & 6 deletions packages/store/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,19 +31,15 @@
"homepage": "https://github.com/Agoric/agoric-sdk#readme",
"dependencies": {
"@agoric/assert": "^0.6.0",
"@agoric/internal": "^0.3.2",
"@endo/eventual-send": "^0.17.2",
"@endo/exo": "^0.2.2",
"@endo/far": "^0.2.18",
"@endo/marshal": "^0.8.5",
"@endo/pass-style": "^0.1.3",
"@endo/patterns": "^0.2.2",
"@endo/promise-kit": "^0.2.56",
"@fast-check/ava": "^1.1.3"
"@endo/patterns": "^0.2.2"
},
"devDependencies": {
"@agoric/swingset-vat": "^0.32.2",
"@agoric/time": "^0.3.2",
"@endo/ses-ava": "^0.2.40",
"ava": "^5.2.0"
},
"files": [
Expand Down
5 changes: 2 additions & 3 deletions packages/swingset-liveslots/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,16 +23,15 @@
"@agoric/vat-data": "^0.5.2",
"@endo/eventual-send": "^0.17.2",
"@endo/exo": "^0.2.2",
"@endo/far": "^0.2.18",
"@endo/init": "^0.5.56",
"@endo/marshal": "^0.8.5",
"@endo/nat": "^4.1.27",
"@endo/pass-style": "^0.1.3",
"@endo/patterns": "^0.2.2",
"@endo/promise-kit": "^0.2.56"
},
"peerDependencies": {
"@endo/far": "^0.2.18",
"@endo/ses-ava": "^0.2.40",
"devDependencies": {
"ava": "^5.2.0"
},
"files": [
Expand Down
14 changes: 7 additions & 7 deletions packages/telemetry/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,13 +28,13 @@
"@endo/init": "^0.5.56",
"@endo/marshal": "^0.8.5",
"@endo/stream": "^0.3.25",
"@opentelemetry/api": "^1.1.0",
"@opentelemetry/exporter-prometheus": "^0.32.0",
"@opentelemetry/exporter-trace-otlp-http": "^0.32.0",
"@opentelemetry/resources": "^1.6.0",
"@opentelemetry/sdk-metrics": "^0.32.0",
"@opentelemetry/sdk-trace-base": "^1.6.0",
"@opentelemetry/semantic-conventions": "^1.6.0",
"@opentelemetry/api": "~1.3.0",
"@opentelemetry/exporter-prometheus": "~0.35.0",
"@opentelemetry/exporter-trace-otlp-http": "~0.35.0",
"@opentelemetry/resources": "~1.9.0",
"@opentelemetry/sdk-metrics": "~1.9.0",
"@opentelemetry/sdk-trace-base": "~1.9.0",
"@opentelemetry/semantic-conventions": "~1.9.0",
"anylogger": "^0.21.0",
"better-sqlite3": "^8.2.0",
"bufferfromfile": "agoric-labs/BufferFromFile#Agoric-built",
Expand Down
3 changes: 2 additions & 1 deletion packages/time/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,8 @@
},
"files": [
"*.js",
"NEWS.md"
"NEWS.md",
"src"
Copy link
Member

Choose a reason for hiding this comment

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

could we do a build instead so we're not back to exporting all the modules?

Copy link
Member Author

Choose a reason for hiding this comment

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

I don't see how this is any worse than the status quo. This package.json is not viable: it produces a tarball that doesn't have any implementation. That broke the integration test.

What kind of build do you have in mind? If you just care about exports, let's add packageJson.exports, but I don't want to tackle that in this PR.

Copy link
Member

Choose a reason for hiding this comment

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

I don't see how this is any worse than the status quo.

It's net better, for sure. But it fails at something that was intended and I wonder if we can make it work as intended.

I had in mind a dist/ style build but I think your packageJson.exports suggestion is better. I agree it can wait for another PR.

],
"publishConfig": {
"access": "public"
Expand Down
2 changes: 2 additions & 0 deletions packages/vats/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,8 @@
"files": [
"CHANGELOG.md",
"src/",
"scripts/",
"tools/",
"*.json",
"globals.d.ts",
"exported.js"
Expand Down
1 change: 1 addition & 0 deletions packages/xsnap/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@
"files": [
"LICENSE*",
"api.js",
"build.env",
"src"
],
"publishConfig": {
Expand Down
2 changes: 1 addition & 1 deletion packages/zoe/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
"build": "yarn build:bundles",
"build:bundles": "node scripts/build-bundles.js",
"prepack": "echo \"export {}; \" | cat - tools/types-ambient.js > tools/types.js && tsc --build jsconfig.build.json",
"postpack": "git clean -f '*.d.ts*'",
"postpack": "git clean -f '*.d.ts*' tools/types.js",
Copy link
Member

Choose a reason for hiding this comment

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

this is more correct. was it also part of an observed problem?

Copy link
Member Author

Choose a reason for hiding this comment

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

Yes, leaving behind garbage in the repo after yarn pack.

"test": "ava --verbose",
"test:c8": "c8 $C8_OPTIONS ava --config=ava-nesm.config.js",
"test:unit": "ava 'test/unitTests/**/test-*.js' -T 1m --verbose",
Expand Down
Loading