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

Cleanup DApp - Remove Unused Stuff, Reorganize Rest #88

Merged
merged 12 commits into from
Dec 6, 2024
Merged

Conversation

amessbee
Copy link
Contributor

@amessbee amessbee commented Nov 12, 2024

As discussed in the Nov 4, 2024, Team-Devrel sync, here is a proposed cleanup of a few things before we add more contracts.

The changes in this pull request are:

  • .github/workflows/pr.yml

Updated build step name from "Build dapp-agoric-basics" to "Build dapp-orchestration-basics"
Changed logging steps and verification step names to be more descriptive

  • .gitignore

Added contract/bundles and new entries for e2e-testing files

  • contract/Makefile

Updated and removed unused targets

  • package.json and contract/package.json

Removed unused scripts.

  • Removed unused/duplicate scripts and updated corresponding paths.

Ref(s):

@amessbee amessbee force-pushed the ms/cleanup branch 11 times, most recently from 505ea34 to 83e9cf2 Compare November 13, 2024 04:01
@amessbee amessbee force-pushed the ms/cleanup branch 2 times, most recently from ae90c94 to 73bbd40 Compare November 13, 2024 06:17
@amessbee amessbee marked this pull request as ready for review November 13, 2024 06:49
Copy link
Member

@mujahidkay mujahidkay left a comment

Choose a reason for hiding this comment

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

Good stuff. And this is a good start. It cleans up the major, glaring unused stuff and I'm happy with this. Left a couple minor comments. We can do follow-up cleanups along the way when incorporating other contracts

"start:ui": "cd ui && yarn dev",
"format": "yarn prettier --write .github contract ui",
"lint:format": "yarn prettier --check .github contract ui",
"lint": "yarn lint:format && yarn workspaces foreach --all run lint",
"lint:fix": "yarn format && yarn workspaces foreach --all run lint:fix",
Copy link
Member

Choose a reason for hiding this comment

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

I believe we need to keep this

"test": "yarn workspaces foreach --all run test",
"build": "yarn workspaces foreach --all run build",
"postinstall": "npx patch-package"
Copy link
Member

Choose a reason for hiding this comment

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

not sure if there are any repercussions for removing this. Will let @Jovonni confirm this.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@mujahidkay brought them back.

@amessbee amessbee requested a review from mujahidkay November 15, 2024 04:13
Copy link
Member

@mujahidkay mujahidkay left a comment

Choose a reason for hiding this comment

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

Please capture the relevant GH issue in PR description before merging (and after @Jovonni 's signoff/approval)

Copy link
Member

@dckc dckc left a comment

Choose a reason for hiding this comment

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

various suggestions...

Comment on lines -8 to -10
"start:docker": "docker compose up -d",
"docker:logs": "docker compose logs --tail 200 -f",
"docker:bash": "docker compose exec agd bash",
Copy link
Member

Choose a reason for hiding this comment

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

Since this start:docker and docker:logs are our getting started docs, I suggest that yarn start:docker and the like should give a diagnostic about what to do instead. (Be sure to give a failing exit code.)

Or... if it's easy enough to just make docker:logs work (i.e. show the agd logs) then we should do that. (likewise docker:bash)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Good point.

  • start:docker now points to readme in multichain-testing to setup env
  • docker:logs now shows agd logs
  • docker:bash now opens agoriclocal-genesis-0 shell

"docker:bash": "docker compose exec agd bash",
"docker:make": "docker compose exec agd make -C /workspace/contract",
"make:help": "make list",
"start": "make clean start",
Copy link
Member

Choose a reason for hiding this comment

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

likewise yarn start should give a clue about what to do instead.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

yarn start now deploys contract on chain, i.e., make e2e
Updated the rest same as above.

ui/package.json Outdated
@@ -9,9 +9,7 @@
"build": "tsc && NODE_OPTIONS=--max-old-space-size=4096 vite build",
"lint": "yarn tsc && eslint . --ext ts,tsx --report-unused-disable-directives --max-warnings 0",
"lint:fix": "yarn lint --fix",
"preview": "vite preview",
"test": "exit 0",
Copy link
Member

Choose a reason for hiding this comment

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

yarn test seems like it should stay

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Fixed.


PROVISION_POOL_ADDR=agoric1megzytg65cyrgzs6fvzxgrcqvwwl7ugpt62346
ADDR := $(shell kubectl exec -i agoriclocal-genesis-0 -c validator -- sh -c '\
if ! agd keys show $(USERNAME) >/dev/null 2>&1; then \
Copy link
Member

Choose a reason for hiding this comment

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

Is there some reason we don't use a fixed mnemonic and address for user1?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Plan to work on this in a subsequent PR unless someone else gets to it before me.

@@ -163,12 +50,9 @@ fund: fund-provision-pool check-balance
fund-osmo:
kubectl exec -i osmosislocal-genesis-0 -c validator -- osmosisd tx bank send faucet ${CLIENT_OSMO_ADDR} 9870000000uosmo --fees 1000uosmo -y;
Copy link
Member

Choose a reason for hiding this comment

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

I suggest factoring out EXEC_AGD and EXEC_OSMO like...

EXEC_AG0=kubectl exec -i agoriclocal-genesis-0 -c validator --

Then the k8s stuff doesn't get in the way when reading stuff like...

provision-smart-wallet:
$(EXEC_AG0) agd tx swingset provision-one wallet $(ADDR) SMART_WALLET --from $(ADDR) -y -b block

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done.

Copy link
Member

Choose a reason for hiding this comment

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

tools is usually js code. Maybe scripts?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Unless there is a known purpose for this script, I am removing it.

* @param {string} name
* @param {boolean | 'verbose'} enable
*/
export const makeTracer = (name, enable = true) => {
Copy link
Member

Choose a reason for hiding this comment

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

Are we getting makeTracer from somewhere else?

If we're just not using it currently, I suggest keeping it around for occasional usage.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This a duplicate file - there is already another one in use.

@@ -6,6 +6,7 @@
"type": "module",
"scripts": {
"test": "ava",
"build:deployer": "rollup -c rollup.config.mjs",
Copy link
Member

Choose a reason for hiding this comment

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

Is this project still using rollup?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

No, it does not but there some tests still using it. Maybe we can clean that later.

Copy link
Member

Choose a reason for hiding this comment

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

There's a reference to this file from deployment code that needs to be updated, I'm pretty sure.

ok... looks like it was fixed in a later commit.

Copy link
Member

Choose a reason for hiding this comment

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

Are we keeping contract/src/platform-goals/start-contract.js? Then the README helps a little.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

README is back - although it does not say anything useful AFAICT.

@amessbee amessbee requested a review from dckc November 22, 2024 04:52
Copy link
Member

@dckc dckc left a comment

Choose a reason for hiding this comment

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

My comments have been addressed; thanks.

As I wasn't at the Nov 4 meeting, I don't think I'm in a good position to approve this.

@amessbee amessbee merged commit 0688d41 into main Dec 6, 2024
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants