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: linking and project listing commands #450

Merged
merged 23 commits into from
Mar 13, 2024

Conversation

aorumbayev
Copy link
Collaborator

@aorumbayev aorumbayev commented Mar 8, 2024

Proposed Changes

Command Line Interface Enhancements

  • List Command Support: Introduces a simple ls command for browsing currently available projects in the workspace, enhancing navigation and project visibility.
  • Link Command Support: Simplifies the use of the algokit generate command by allowing interactive invocation or exporting typed clients from sibling contract projects, streamlining the development workflow.

Deployment and Bootstrap Enhancements

  • Deployment Flexibility: Enables deployment from the workspace root by specifying a project name with algokit deploy, allowing for more centralized management of projects.
  • Bootstrap Enhancements: Adds the capability to use algokit bootstrap with filters by project type or name, facilitating targeted initialization of projects.

Run Command Improvements

  • Environment File Specification: Enhances the run command to support an env_file field, prioritizing the loading of custom environment files. This feature defaults to .env files if present and ultimately loads the global context, ensuring environmental configurations are accurately applied.
  • Filtering Capabilities: Introduces filtering by project-type and name in run commands when orchestrated from the root, allowing for more refined execution control.
  • Multiple Commands Support: Adds the ability to specify multiple commands under run, offering a cross-platform alternative to Unix-like command chaining. This ensures commands are valid and resolved before execution, enhancing command flexibility and reliability.

GitHub Actions and Workspace Management

  • GitHub Files Resolution: Addresses the handling of .github files for standalone projects. With the workspace flag enabled, GitHub actions within standalone projects are not discoverable by default -> hence the fix. Implements a move operation for any .github folder content at the project's root to the workspace's root .github folder post-initialization. This change resolves a bug from the 1.12.x release that required manual movement of standalone production preset templates to the workspace structure.

TODO

  • - snap shot tests for link and list commands, edge cases for deploy and boostrap
  • - documentation

Related template PRs:

algorandfoundation/algokit-react-frontend-template#27
algorandfoundation/algokit-python-template#7
algorandfoundation/algokit-base-template#3
algorandfoundation/algokit-fullstack-template#22

Copy link

github-actions bot commented Mar 10, 2024

Coverage

Coverage Report
FileStmtsMissCoverMissing
src/algokit
   __init__.py15753%6–13, 17–24, 32–34
   __main__.py440%1–7
src/algokit/cli
   __init__.py45198%33
   completions.py108298%83, 98
   dispenser.py121199%77
   doctor.py48394%142–144
   explore.py501276%34–39, 41–46
   generate.py69396%76–77, 142
   goal.py44198%71
   init.py2994286%396–397, 460–483, 498, 501–503, 514, 518, 574, 600, 629, 662, 671–673, 676–681, 694, 713, 725–726, 743–746
   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/project
   deploy.py992080%47, 49, 101, 124, 146–148, 227, 234, 248–256, 259–268
   link.py881682%60, 65–66, 88–92, 102–107, 135–136, 198–199, 203
   list.py27293%47–52
   run.py47785%39, 72, 163, 177–181
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
   conf.py57984%12, 24, 28, 36, 38, 73–75, 80
   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.py34682%48, 52–57, 65
   log_handlers.py68790%50–51, 63, 112–116, 125
   proc.py45198%98
   sandbox.py2181892%62, 73–75, 96, 142–149, 160, 457, 473, 498, 506
   typed_client_generation.py80594%55–57, 70, 75
   utils.py1333474%46–47, 51–70, 131, 134, 140–154, 171–173, 236
   version_prompt.py921485%37–38, 68, 87–90, 108, 118–125, 148
src/algokit/core/project
   __init__.py531081%50, 86, 145, 161–170
   bootstrap.py122893%48, 126–127, 149, 176, 208–210
   deploy.py54983%61–64, 73–75, 79, 84
   run.py1151587%82, 87, 96–97, 132–133, 137–138, 142, 146, 247–255, 270
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
TOTAL404350588% 

Tests Skipped Failures Errors Time
437 0 💤 0 ❌ 0 🔥 24.755s ⏱️

@aorumbayev aorumbayev force-pushed the feat/orchestration-linking branch from 27715ca to 925da4f Compare March 10, 2024 14:18
.python-version Outdated Show resolved Hide resolved
docs/features/init.md Outdated Show resolved Hide resolved
docs/features/project/deploy.md Outdated Show resolved Hide resolved
docs/features/project/link.md Outdated Show resolved Hide resolved
docs/features/project/deploy.md Outdated Show resolved Hide resolved
src/algokit/cli/project/deploy.py Outdated Show resolved Hide resolved
src/algokit/cli/project/deploy.py Outdated Show resolved Hide resolved
src/algokit/cli/project/deploy.py Outdated Show resolved Hide resolved
src/algokit/cli/project/link.py Outdated Show resolved Hide resolved
src/algokit/core/project/__init__.py Outdated Show resolved Hide resolved
@aorumbayev aorumbayev mentioned this pull request Mar 11, 2024
2 tasks
@aorumbayev
Copy link
Collaborator Author

aorumbayev commented Mar 11, 2024

@PhearZero @joe-p @Loedn @iskysun96 - available from branch for any further feedback. To test this out use:

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

Please note only react/puya and their fullstack combo are currently updated to latest, beaker is to be updated after puya is reviewed, for tealscript ill add a simple build/test run declarations into toml @joe-p but for the rest refer to official templates to get tealscript template codebase up to date with latest conventions (notion of presets, tests, ci/cd, code tours, generators etc).

@aorumbayev aorumbayev marked this pull request as ready for review March 11, 2024 18:52
logger.debug(f"No files found in .github folder after merge. Removing `.github` directory at {source_dir}...")
return

click.echo(
Copy link
Contributor

Choose a reason for hiding this comment

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

It appears that this will only render if there are files found in the project .github folder.
To me this should be printed always at the start and we should replace this message with something like below:

Failed to move all files within your project's .githubfolder to the workspace root. Please review any files that remain in your project's.githubfolder and manually include in the root.github directory as required.

@aorumbayev aorumbayev merged commit 2b1ba40 into feat/command_orchestration Mar 13, 2024
14 checks passed
aorumbayev added a commit that referenced this pull request Mar 25, 2024
* chore: algokit project poc

* feat: initial implementation

* chore: merge conflicts

* chore: fixing ruff errors

* chore: regen docs

* chore: testing ci

* chore: testing ci

* chore: testing ci

* chore: testing ci

* chore: testing ci

* chore: testing ci

* chore: testing ci

* chore: minor refinements; adding env var passing; verbose validation

* chore: testing ci

* chore: patching docstrings

* chore: patching tests

* chore: testing ci

* docs: refining documentation and further polish

* chore: adding option to pass custom env file

* chore: addressing pr comments on docs

Co-authored-by: Neil Campbell <[email protected]>

* chore: fix line too long

* chore: removing typos; minor tweaks

* feat: linking and project listing commands (#450)

* chore: env_file file param; list command; link command

* chore: wip

* chore: wip

* chore: wip

* chore: wip

* chore: making deploy and bootstrap compatible with workspaces

* chore: wip

* chore: test

* chore: wip

* chore: wip

* feat: initial implementation of link and list commands; github folder handler

* chore: windows compatibility

* test: fixing windows compatibility

* chore: minor tweaks

* docs: pr feedback

Co-authored-by: Neil Campbell <[email protected]>

* chore: addressing pr feedback

* docs: regen docs

* chore: addressing pr feedback

* chore: minor refinements

* docs: minor paraphrasing of help strings

* chore: refining link behaviour; extra test case

---------

Co-authored-by: Neil Campbell <[email protected]>

* chore: merge conflicts

* chore: extra test cases

* fix: enforce utf-8 encoding to proc.run by default; do not resolve run cmd until run

* chore: addressing pr feedback

* chore: minor tweaks

* chore: adjusting beaker to point to feat branch

* chore: minor refinements

* chore: adding tealscript to point to temp feature branch

* chore: patching docs

* fix: adding search glob for arc32.json prefixed specs

* feat: orchestration pr feedback (#460)

* fix: addressing pr comments; minor improvements

* chore: testing ci

* chore: testing ci

* chore: testing ci

* chore: testing ci

* chore: wip

* docs: regen docs

* fix: windows bug during git init

* chore: regen tests

* chore: fix test issues

* chore: minor refinements

* chore: renaming puya to python

* docs: regen docs

* chore: renaming puya template repo

* chore: merge conflicts

---------

Co-authored-by: Neil Campbell <[email protected]>
aorumbayev added a commit that referenced this pull request Mar 27, 2024
* feat: Add puyapy compile integration (#457)

* feat: enable puya integration

* chore: doc

* chore: refactor compile command and enhance the docs

* docs: wording tweaks to the compile docs

* chore: change install to run, as I think it is the behaviour we want

* chore: fix snapshots

* fix: resolve issue running on windows

* chore: add info about PuyaPy Python version and matching behaviour.

* chore: fix snapshots

* chore: wording tweaks

* chore: allowing running puya with no color

* docs: adjust compile command terminology

---------

Co-authored-by: Neil Campbell <[email protected]>

* feat: command orchestration (#446)

* chore: algokit project poc

* feat: initial implementation

* chore: merge conflicts

* chore: fixing ruff errors

* chore: regen docs

* chore: testing ci

* chore: testing ci

* chore: testing ci

* chore: testing ci

* chore: testing ci

* chore: testing ci

* chore: testing ci

* chore: minor refinements; adding env var passing; verbose validation

* chore: testing ci

* chore: patching docstrings

* chore: patching tests

* chore: testing ci

* docs: refining documentation and further polish

* chore: adding option to pass custom env file

* chore: addressing pr comments on docs

Co-authored-by: Neil Campbell <[email protected]>

* chore: fix line too long

* chore: removing typos; minor tweaks

* feat: linking and project listing commands (#450)

* chore: env_file file param; list command; link command

* chore: wip

* chore: wip

* chore: wip

* chore: wip

* chore: making deploy and bootstrap compatible with workspaces

* chore: wip

* chore: test

* chore: wip

* chore: wip

* feat: initial implementation of link and list commands; github folder handler

* chore: windows compatibility

* test: fixing windows compatibility

* chore: minor tweaks

* docs: pr feedback

Co-authored-by: Neil Campbell <[email protected]>

* chore: addressing pr feedback

* docs: regen docs

* chore: addressing pr feedback

* chore: minor refinements

* docs: minor paraphrasing of help strings

* chore: refining link behaviour; extra test case

---------

Co-authored-by: Neil Campbell <[email protected]>

* chore: merge conflicts

* chore: extra test cases

* fix: enforce utf-8 encoding to proc.run by default; do not resolve run cmd until run

* chore: addressing pr feedback

* chore: minor tweaks

* chore: adjusting beaker to point to feat branch

* chore: minor refinements

* chore: adding tealscript to point to temp feature branch

* chore: patching docs

* fix: adding search glob for arc32.json prefixed specs

* feat: orchestration pr feedback (#460)

* fix: addressing pr comments; minor improvements

* chore: testing ci

* chore: testing ci

* chore: testing ci

* chore: testing ci

* chore: wip

* docs: regen docs

* fix: windows bug during git init

* chore: regen tests

* chore: fix test issues

* chore: minor refinements

* chore: renaming puya to python

* docs: regen docs

* chore: renaming puya template repo

* chore: merge conflicts

---------

Co-authored-by: Neil Campbell <[email protected]>

* chore: pin algokit client generator version (#455)

* chore: pin the generator client version by user

* fix: checking for available version

* fix: mypy issues

* test: adding tests

* chore: fix ruff errors

* chore: fix a test and ruff

* chore: update docs

* chore: add a log for a testing

* chore: update logs

* chore: revert the algokit-client-generator dependency

* chore: revert the lock file

* fix: github test on macos

* fix: get use of installed versions

* test: add tests

* fix: some tests

* test: fix some snapshots

* chore: fix ruff

* chore: fix test and pipx run command in windows

* feat: add support for finding a project installed python client generator command

* feat: add support for finding a globally installed ts client generator command

* chore: update docs

* chore: add some debug logs

* chore: update snapshots

* chore: add more tests

* chore: tweak

* chore: merging v2 into branch

* chore: remove orig

* chore: refine test cases for link command

---------

Co-authored-by: Neil Campbell <[email protected]>
Co-authored-by: Altynbek Orumbayev <[email protected]>

* chore: add version option to link command

* chore: minor fixes

* docs: update readme

* docs: add Algorand Python and TEALScript to readme

* chore: change puya to puyapy

* chore: fix windows compile test

* chore: fix test

* chore: ignore test for now

* chore: fix windows compile test

* chore: temporarily disable test

* fix: fixing an issue causing workspace nesting check even if user said yes to overwrite

* chore: use version rather than help for puyapy detects

* docs: update example contract in docs

* chore: removing tmp branches on templates

BREAKING CHANGE: 2.0 release

---------

Co-authored-by: Hoang Dinh <[email protected]>
Co-authored-by: Neil Campbell <[email protected]>
Co-authored-by: Negar <[email protected]>
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