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

feat: init wizard v2 #415

Merged
merged 40 commits into from
Feb 26, 2024
Merged

feat: init wizard v2 #415

merged 40 commits into from
Feb 26, 2024

Conversation

aorumbayev
Copy link
Collaborator

@aorumbayev aorumbayev commented Feb 13, 2024

Implements https://github.com/orgs/algorandfoundation/projects/1?pane=issue&itemId=53079977

Proposed Changes

This is a draft moving the PoC for init wizard v2 discussed in #411.
The adr is split into 2 parts and this PR will be covering the improvements in wizard v2 + changes in related template repos.

Currently the draft contains poc code shown during the init wizard v2 discussions for the ADR. The PR is to be refined and turned into a full implementation by the time it leaves the draft state.

To interact with the PoC simply checkout the branch and access algokit inside poetry environment. Please note that tealscript template variation is not yet fully covered as poc was demoing a happy path from start to fullstack with puya + react components (this is to be patched soon).

Template PRs

Above has to be merged first -> branch refs has to be then removed on this PR, afterwards ready to release new cli version

Copy link

github-actions bot commented Feb 13, 2024

Coverage

Coverage Report
FileStmtsMissCoverMissing
src/algokit
   __init__.py15753%6–13, 17–24, 32–34
   __main__.py440%1–7
src/algokit/cli
   completions.py108298%83, 98
   deploy.py72790%44, 46, 92–94, 158, 182
   dispenser.py121199%77
   doctor.py48394%142–144
   explore.py501276%34–39, 41–46
   generate.py67396%74–75, 140
   goal.py44198%71
   init.py2752591%388–389, 444, 447–449, 460, 464, 520, 546, 575, 608, 617–619, 622–627, 640, 657, 669–670, 687–690
   localnet.py1191587%74–78, 111, 123, 138–148, 161, 206, 227–228
   task.py34391%25–28
src/algokit/cli/common
   utils.py26292%120, 123
src/algokit/cli/tasks
   analyze.py81199%81
   assets.py821384%65–66, 72, 74–75, 105, 119, 125–126, 132, 134, 136–137
   ipfs.py51884%52, 80, 92, 94–95, 105–107
   mint.py66494%48, 70, 91, 250
   send_transaction.py651085%52–53, 57, 89, 158, 170–174
   sign_transaction.py59886%21, 28–30, 71–72, 109, 123
   transfer.py39392%26, 90, 117
   utils.py994555%26–34, 40–43, 75–76, 100–101, 125–133, 152–162, 209, 258–259, 279–290, 297–299
   vanity_address.py561082%41, 45–48, 112, 114, 121–123
   wallet.py79495%21, 66, 136, 162
src/algokit/core
   bootstrap.py1191191%42, 106–107, 129, 156, 185–190
   conf.py661577%12, 24, 28, 36, 38, 72–74, 92–100
   deploy.py691184%61–64, 73–75, 79, 84, 91–93
   dispenser.py2022687%91, 123–124, 141–149, 191–192, 198–200, 218–219, 259–260, 318, 332–334, 345–346, 356, 369, 384
   doctor.py65789%67–69, 92–94, 134
   generate.py48394%44, 81, 99
   goal.py60395%30–31, 41
   init.py39685%59, 63–68, 76
   log_handlers.py68790%50–51, 63, 112–116, 125
   proc.py45198%98
   sandbox.py2181892%62, 73–75, 96, 142–149, 160, 456, 472, 497, 505
   typed_client_generation.py80594%55–57, 70, 75
   utils.py1043170%44–45, 49–68, 129, 132, 138–152
   version_prompt.py72889%26–27, 39, 58–61, 79, 108
src/algokit/core/tasks
   analyze.py93397%105–112, 187
   ipfs.py63789%58–64, 140, 144, 146, 152
   nfd.py491373%25, 31, 34–41, 70–72, 99–101
   vanity_address.py903462%49–50, 54, 59–75, 92–108, 128–131
   wallet.py71593%37, 129, 155–157
src/algokit/core/tasks/mint
   mint.py781087%123–133, 187
   models.py901188%50, 52, 57, 71–74, 85–88
TOTAL360942688% 

Tests Skipped Failures Errors Time
407 0 💤 0 ❌ 0 🔥 22.322s ⏱️

@@ -61,14 +81,17 @@ def _get_blessed_templates() -> dict[str, BlessedTemplateSource]:
"puya": BlessedTemplateSource(
url="gh:algorandfoundation/algokit-puya-template",
description="Official starter template for Puya applications (Dev Preview, not recommended for production)",
branch="poc/wizard_v2",
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

@robdmoore @neilcampbell please note this is a temporary change done for the sake of adr given that dependant templates also rely on changes on specific branch

src/algokit/cli/init.py Outdated Show resolved Hide resolved
@aorumbayev
Copy link
Collaborator Author

@robdmoore @neilcampbell still keeping the pr in draft for ~1 more day until related prs on templates are opened too, added extra tests here and minor tweaks but should mostly be ready for review already

@aorumbayev aorumbayev marked this pull request as ready for review February 16, 2024 20:13
@aorumbayev
Copy link
Collaborator Author

@neilcampbell @robdmoore added extra logic as per latest discussions, adds optional behaviour that transforms any standalone template into a workspace structure by default OR if its already init'd from root of a workspace project it will auto inject the standalone template under expected folder. Let me know what you think, ignore the tests for now - will patch on monday

@aorumbayev aorumbayev marked this pull request as draft February 19, 2024 16:15
@aorumbayev
Copy link
Collaborator Author

aorumbayev commented Feb 19, 2024

@robdmoore @neilcampbell added extra documentation and usage of https://github.com/algorandfoundation/algokit-base-template to enforce workspace structure by default. This base is reused within all official templates (including fullstack) and decouple files that we want to see in the base structure from individual templates.

The best way to get a hang of the latest state is to checkout the branch and interact with the new wizard within poetry shell.

Would appreciate initial round of reviews as there are still certain open questions:

  1. Do we want to include an optional arg to control max bootstrap lookup depth? Currently i've tweaked it to be 2 by default and user can control an optional arg via init, the default lookup for bootsrap all command is reusing same method so its also 2 by default. Not sure if want to also want to expand remaining commands or scope it out for minor improvement. We decided to not expose this until needed, user can always cd into target folder if bootstrap is needed at custom location.
  2. Took some time to patch existing init tests, and they all were mostly tailored for the old wizard so im adding the --no-workspace everywhere in the old tests, there is a few new tests specifically for the init wizard v2 flow, will add a few extra edge cases but if youll spot anything critical in the pr that you think is not covered with tests let me know.
  3. PRs are still pending on beaker, react, puya and fullstack (you should be able to interact with the wip changes when checking out and running algokit locally from this branch those). Want to ensure everything is solid on cli side first before i jump to finalizing the template changes (luckily should be fairly small and won't have anything backwards incompatible). Also let me know what you think of the usage of https://github.com/algorandfoundation/algokit-base-template, i think it simplifies the injection of common workspace structure by a good margin. -> PRs are ready, description is updated
  4. @joe-p will reach out in case any extra help might be needed on tealscript, currently there is no notion of presets on that repo and it might make sense to also move it to foundation org. Let's discuss more with @Loedn as well once we got all main PRs on puya, fullstack, beaker, react ready to be merged 👍

cc @PhearZero @joe-p @CiottiGiorgio @iskysun96 - feel free to try it out as well if you want to provide preliminary feedback, please note the branch might still have further commits AFTER we coordinate opening prs on templates. Template prs will be merged first then we will make the prerelease on the cli and will coordinate with @Loedn to have an interactive feedback session to patch any last minute tweaks before end of month. Otherwise if all good i'll jump to part 2 (which will add orchestration on top of whats enforced with the new features in this pr)

@robdmoore
Copy link
Contributor

pipx install git+https://github.com/algorandfoundation/algokit-cli@feat/init_wizard_v2

@robdmoore
Copy link
Contributor

Got an error on Windows, also it didn't ask me for smart contract language
image

@aorumbayev
Copy link
Collaborator Author

aorumbayev commented Feb 21, 2024

@neilcampbell all templates should be up to date with latest - so running algokit cli from this branch should not have any e2e problems (only tested on windows so far though, but binaries portability tests add a bit more confidence).

A PR for fullstack is available here algorandfoundation/algokit-fullstack-template#19, once base template is public i'll open prs on remaining repos (no reason to open now since all will fail due to base being private repo)

will resolve your comments a bit later (some of those are already addressed, just didn't have time to resolve individually yet)

@aorumbayev aorumbayev marked this pull request as ready for review February 21, 2024 14:20
@aorumbayev
Copy link
Collaborator Author

@robdmoore thanks for reporting on the bugs so far - they are fixed now, let me know if there are any further comments. Also refer to updated pr description that includes refs to prs on respective react, fullstack, beaker and puya templates

@aorumbayev aorumbayev changed the title feat: init wizard v2 [draft] feat: init wizard v2 Feb 21, 2024
docs/cli/index.md Outdated Show resolved Hide resolved
docs/features/init.md Outdated Show resolved Hide resolved
@aorumbayev
Copy link
Collaborator Author

aorumbayev commented Feb 23, 2024

@joe-p @PhearZero just fyi, as agreed i updated child templates to come shipped with type contract by default in the .toml. So now we got workspace, backend, frontend, contract types (no templates containing backend yet but we can assume its a supported category). As for suggestion to make opening in code workspaces optional (for full stack), i forgot to mention that cli already supports a flag --no-ide which you can pass to instruct it to ignore auto opening the IDE @joe-p , remaining bits are going to be revisited during orchestration work from next week and we may have another feedback session some time next week to go over the orchestration as well.

As for this pr and all prs on templates, we will coordinate a release on monday with @neilcampbell and @Loedn

@aorumbayev aorumbayev merged commit 55d6922 into main Feb 26, 2024
14 checks passed
@aorumbayev aorumbayev deleted the feat/init_wizard_v2 branch March 4, 2024 10:37
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.

3 participants