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

fix: use dapp-offer-up by default #8630

Merged
merged 9 commits into from
Jan 26, 2024
Merged

fix: use dapp-offer-up by default #8630

merged 9 commits into from
Jan 26, 2024

Conversation

dckc
Copy link
Member

@dckc dckc commented Dec 6, 2023

closes: #8690

Description

Change the default dapp used in yarn create @agoric/dapp from fungible faucet to dapp-offer-up.

cc @sufyaankhan @toliaqat @0xpatrickdev

Security / Scaling / Upgrade Considerations

n/a

Documentation Considerations

Part of a larger docs transition:

Testing Considerations

In due course, we aim to test the new getting started approach in ci. Initially, @kbennett2000 has agreed to do regular manual testing.

@dckc dckc marked this pull request as ready for review December 14, 2023 23:19
@dckc dckc changed the title use dapp-game-pieces (in agoric-labs) by default fix: use dapp-offer-up by default Dec 14, 2023
@dckc
Copy link
Member Author

dckc commented Dec 14, 2023

@mhofman @michaelfig just merging this won't affect the behavior of yarn create @agoric/dapp demo right? How does this get to npm?

@dckc dckc requested review from michaelfig and toliaqat December 14, 2023 23:21
@mhofman
Copy link
Member

mhofman commented Dec 14, 2023

@mhofman @michaelfig just merging this won't affect the behavior of yarn create @agoric/dapp demo right? How does this get to npm?

Correct. It would need to be part of a release: cherry picked to release branch and a release being created. Currently we only create releases with chain upgrades.

const DEFAULT_DAPP_TEMPLATE = 'dapp-fungible-faucet';
const DEFAULT_DAPP_TEMPLATE = 'dapp-offer-up';
Copy link
Member

Choose a reason for hiding this comment

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

I expect the integration tests would need to be updated as well.

Copy link
Member Author

Choose a reason for hiding this comment

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

"the integration tests"?

hmm.. I see https://github.com/Agoric/agoric-sdk/blob/master/.github/workflows/integration.yml#L39
programming in yaml... I'm struggling to follow... seems to lead to...
https://github.com/Agoric/agoric-sdk/blob/master/scripts/registry.sh

But I don't see any use of yarn create @agoric/dapp. What am I missing?

Copy link
Member

Choose a reason for hiding this comment

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

run: scripts/registry.sh test ${{ matrix.cli }} ${{steps.get-branch.outputs.result}}

Leads to

persistVar AGORIC_INIT_OPTIONS "[\"--dapp-branch=$2\"]"

The current getting started steps are captured in that script and another.

While neither reference the new dapp-create, that package is just a wrapper for the agoric cli.

Copy link
Member Author

Choose a reason for hiding this comment

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

another? what other? Perhaps all will become clear if I study some ci logs.

Copy link
Member

Choose a reason for hiding this comment

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

Yes, registry.sh triggers a yarn command in agoric-cli after setting up some environment variables

yarn integration-test

which ultimately bottoms out in https://github.com/Agoric/agoric-sdk/blob/d61be8d7fbda7dd3846cba38f8829e36bfae92a4/packages/agoric-cli/tools/getting-started.js

@dckc dckc marked this pull request as draft December 15, 2023 17:49
@LuqiPan LuqiPan self-assigned this Jan 25, 2024
@LuqiPan
Copy link
Contributor

LuqiPan commented Jan 25, 2024

Testing this change locally

Checked out this branch: git checkout dckc-patch-1

Modified the version field in [repo]/packages/agoric-cli/package.json to be "version": "0.21.1.create-dapp-test",

Ran yarn link then yarn link "@agoric/sdk" so that I'm using my local branch

Verified that I'm indeed using my local branch:

yarn agoric --version
yarn run v1.22.19
$ /Users/luqi/github/Agoric/agoric-sdk/node_modules/.bin/agoric --version
0.21.1.create-dapp-test
✨  Done in 0.64s.

Ran yarn agoric init demo and observed that we're indeed using dapp-offer-up as template without providing --dapp-base or --dapp-template as argument

yarn agoric init demo
yarn run v1.22.19
$ /Users/luqi/github/Agoric/agoric-sdk/node_modules/.bin/agoric init demo
agoric: init: initializing demo from https://github.com/Agoric/dapp-offer-up
agoric: init: git clone --origin=upstream --depth 1 --shallow-submodules https://github.com/Agoric/dapp-offer-up demo
Cloning into 'demo'...
remote: Enumerating objects: 69, done.
remote: Counting objects: 100% (69/69), done.
remote: Compressing objects: 100% (63/63), done.
remote: Total 69 (delta 1), reused 31 (delta 0), pack-reused 0
Receiving objects: 100% (69/69), 230.72 KiB | 1.16 MiB/s, done.
Resolving deltas: 100% (1/1), done.
agoric: init: rm -rf .git
agoric: init: git init
Initialized empty Git repository in /Users/luqi/github/Agoric/agoric-sdk/demo/.git/
agoric: init: rewriting  demo/package.json
agoric: init: rewriting  demo/api/package.json
agoric: init: rewriting  demo/contract/package.json
agoric: init: rewriting  demo/ui/package.json
agoric: init: rewriting  demo/_agstate/agoric-servers/package.json
agoric: init: git add .
agoric: init: git commit -m chore: agoric init demo

Imported from https://github.com/Agoric/dapp-offer-up
[main (root-commit) 8acef08] chore: agoric init demo
 53 files changed, 14536 insertions(+)
 create mode 100644 .github/workflows/pr.yml
 create mode 100644 .gitignore
 create mode 100644 CONTRIBUTING.md
 create mode 100644 README-local-chain.md
 create mode 100644 README.md
 create mode 100644 _agstate/.keep
 create mode 100644 _agstate/agoric-servers/package.json
 create mode 100644 api/README-no-api.md
 create mode 100644 api/package.json
 create mode 100644 contract/.gitignore
 create mode 100644 contract/Makefile
 create mode 100644 contract/jsconfig.json
 create mode 100644 contract/package.json
 create mode 100644 contract/scripts/build-contract-deployer.js
 create mode 100755 contract/scripts/build-proposal.sh
 create mode 100755 contract/scripts/install-bundles.sh
 create mode 100755 contract/scripts/parseProposals.mjs
 create mode 100755 contract/scripts/propose-start-contract.sh
 create mode 100755 contract/scripts/run-chain.sh
 create mode 100755 contract/scripts/voteLatestProposalAndWait.sh
 create mode 100644 contract/src/debug.js
 create mode 100644 contract/src/offer-up-proposal.js
 create mode 100644 contract/src/offer-up.contract.js
 create mode 100644 contract/test/mintStable.js
 create mode 100644 contract/test/prepare-test-env-ava.js
 create mode 100644 contract/test/test-build-proposal.js
 create mode 100644 contract/test/test-bundle-source.js
 create mode 100644 contract/test/test-contract.js
 create mode 100644 contract/test/utils.js
 create mode 100644 docker-compose.yml
 create mode 100644 package.json
 create mode 100644 ui/.eslintrc.cjs
 create mode 100644 ui/index.html
 create mode 100644 ui/package.json
 create mode 100644 ui/public/agoric.svg
 create mode 100644 ui/public/vite.svg
 create mode 100644 ui/src/App.css
 create mode 100644 ui/src/App.spec.tsx
 create mode 100644 ui/src/App.tsx
 create mode 100644 ui/src/assets/map.png
 create mode 100644 ui/src/assets/potionBlue.png
 create mode 100644 ui/src/assets/react.svg
 create mode 100644 ui/src/assets/scroll.png
 create mode 100644 ui/src/index.css
 create mode 100644 ui/src/installSesLockdown.ts
 create mode 100644 ui/src/main.tsx
 create mode 100644 ui/src/vite-env.d.ts
 create mode 100644 ui/test/App.e2e.ts
 create mode 100644 ui/tsconfig.json
 create mode 100644 ui/tsconfig.node.json
 create mode 100644 ui/vite.config.ts
 create mode 100644 ui/yarn.lock
 create mode 100644 yarn.lock
agoric: init: Done initializing demo
✨  Done in 4.99s.

@LuqiPan LuqiPan marked this pull request as ready for review January 25, 2024 20:02
@mhofman mhofman added the force:integration Force integration tests to run on PR label Jan 25, 2024
@@ -103,6 +103,7 @@ export const gettingStartedWorkflowTest = async (t, options = {}) => {
if (process.env.AGORIC_INIT_OPTIONS) {
const opts = JSON.parse(process.env.AGORIC_INIT_OPTIONS);
initOptions.push(...opts);
initOptions['--dapp-template'] = 'dapp-fungible-faucet';
Copy link
Member

Choose a reason for hiding this comment

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

Pretty sure I commented on this earlier, but this isn't correct. The option needs to be set earlier so it can be overridden by env options.

Copy link
Contributor

Choose a reason for hiding this comment

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

@mhofman I ended up updating the parameter in registry.sh directly. CI seems to be passing. What do you think about this approach?

Copy link
Member

@mhofman mhofman left a comment

Choose a reason for hiding this comment

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

I think changing registry.sh isn't quite right.

@@ -107,7 +107,7 @@ integrationTest() {
persistVar AGORIC_INSTALL_OPTIONS "[\"$DISTTAG\"]"
}
persistVar AGORIC_START_OPTIONS '["--rebuild"]'
persistVar AGORIC_INIT_OPTIONS "[\"--dapp-branch=$2\"]"
persistVar AGORIC_INIT_OPTIONS "[\"--dapp-template=dapp-fungible-faucet\"]"
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 think this is correct. Why remove the dapp-branch option?

@@ -103,6 +103,7 @@ export const gettingStartedWorkflowTest = async (t, options = {}) => {
if (process.env.AGORIC_INIT_OPTIONS) {
const opts = JSON.parse(process.env.AGORIC_INIT_OPTIONS);
initOptions.push(...opts);
initOptions['--dapp-template'] = 'dapp-fungible-faucet';
}
t.is(
await myMain(['init', ...initOptions, 'dapp-foo']),
Copy link
Member

Choose a reason for hiding this comment

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

I think the easiest is to put the default options here

Suggested change
await myMain(['init', ...initOptions, 'dapp-foo']),
await myMain(['init', '--dapp-template', 'dapp-fungible-faucet', '--dapp-base', 'https://github.com/Agoric/', ...initOptions, 'dapp-foo']),

Copy link
Contributor

Choose a reason for hiding this comment

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

Ohhh I see. Updated the PR to do that and tests are passing now, thank you!

Omitted --dapp-base because it defaults to "https://github.com/Agoric/"

Ref:

  --dapp-base <base-url>  find the template relative to <base-url> (default: "https://github.com/Agoric/")

Copy link
Member

Choose a reason for hiding this comment

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

Oh right dapp-offer-up moved to the Agoric org, so DEFAULT_DAPP_URL_BASE no longer changes in this PR!

Copy link
Member

@mhofman mhofman left a comment

Choose a reason for hiding this comment

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

LGTM!

Please make sure to squash this one (automerge:squash should do) given the back and forth in the commit history.

@LuqiPan LuqiPan added the automerge:squash Automatically squash merge label Jan 26, 2024
@mergify mergify bot merged commit 1108cfd into master Jan 26, 2024
64 of 66 checks passed
@mergify mergify bot deleted the dckc-patch-1 branch January 26, 2024 20:46
mhofman pushed a commit that referenced this pull request Jan 30, 2024
* use dapp-game-pieces (in agoric-labs) by default

* feat: use dapp-offer-up in @agoric/dapp

* fix(integration-test): update initOptions with '--dapp-template' parameter

* fix(integration-test): set --dapp-template at registry.sh level

* Revert "fix(integration-test): update initOptions with '--dapp-template' parameter"

This reverts commit 2097951.

* Revert "fix(integration-test): set --dapp-template at registry.sh level"

This reverts commit 8ec4ed3.

* fix(integration-test): add --dapp-template parameter to myMain command

* fixup! fix(integration-test): add --dapp-template parameter to myMain command

---------

Co-authored-by: Luqi Pan <luqi@agoric.com>
Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
mhofman pushed a commit that referenced this pull request Jan 30, 2024
* use dapp-game-pieces (in agoric-labs) by default

* feat: use dapp-offer-up in @agoric/dapp

* fix(integration-test): update initOptions with '--dapp-template' parameter

* fix(integration-test): set --dapp-template at registry.sh level

* Revert "fix(integration-test): update initOptions with '--dapp-template' parameter"

This reverts commit 2097951.

* Revert "fix(integration-test): set --dapp-template at registry.sh level"

This reverts commit 8ec4ed3.

* fix(integration-test): add --dapp-template parameter to myMain command

* fixup! fix(integration-test): add --dapp-template parameter to myMain command

---------

Co-authored-by: Luqi Pan <luqi@agoric.com>
Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
mhofman pushed a commit that referenced this pull request Jan 30, 2024
* use dapp-game-pieces (in agoric-labs) by default

* feat: use dapp-offer-up in @agoric/dapp

* fix(integration-test): update initOptions with '--dapp-template' parameter

* fix(integration-test): set --dapp-template at registry.sh level

* Revert "fix(integration-test): update initOptions with '--dapp-template' parameter"

This reverts commit 2097951.

* Revert "fix(integration-test): set --dapp-template at registry.sh level"

This reverts commit 8ec4ed3.

* fix(integration-test): add --dapp-template parameter to myMain command

* fixup! fix(integration-test): add --dapp-template parameter to myMain command

---------

Co-authored-by: Luqi Pan <luqi@agoric.com>
Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
automerge:squash Automatically squash merge force:integration Force integration tests to run on PR
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Update @agoric/dapp to point to dapp-game-places
4 participants