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

chore(just): organize just recipes into modules and add comments to all #2002

Merged
merged 11 commits into from
Mar 21, 2025

Conversation

ethanoroshiba
Copy link
Contributor

@ethanoroshiba ethanoroshiba commented Feb 26, 2025

Summary

Leverages justfile's module system to better organize our recipes and adds descriptive and uniform comments to all.

Background

These changes are meant to make the developer local deployment experience easier to understand and use. One primary goal is for just --list to provide a more helpful list of recipes. This example shows the new style of just deploy:

Available recipes:
    # 
    # Deploys cluster, ingress controller, and entire Astria stack, including rollup with
    # Astrotrek and sequencer faucet.
    all
    # 
    # Deploys local Sequencer and Celestia instance.
    # Usage: 
    #   $just deploy astria-local <NAMESPACE> (default: 'astria-dev-cluster')
    astria-local namespace=defaultNamespace
    # 
    # Deploys a local Astrotrek instance.
    astrotrek
    # 
    # Deploys local auctioneer.
    auctioneer
    # 
    # Deploys local EVM Bridge Withdrawer and awaits its readiness.
    bridge-withdrawer
    # 
    # Deploys a local Kubernetes cluster.
    # Usage:
    #   $just deploy cluster <NAMESPACE> <ENABLE_HUBBLE> (defaults: 'astria-dev-cluster', 'false')
    cluster namespace=defaultNamespace enableHubble=hubbleEnabled
    ...

The oddity of the extra line in the comment is to enforce that single line comments aren't placed to the right of the recipe, which causes formatting problems.

Another goal of these changes is to make the recipes themselves easier to navigate by splitting into submodules and following clear styling throughout (which aids greatly in identifying recipes if one doesn't have just syntax highlighting).

The final aim of these changes is to make the command line outputs easier to understand by hiding a lot of extraneous information, such as outputs and just recipe calls (automatically listed usually).

Changes

  • Added just directory to charts, containing modules clean, delete, deploy, evm, init, and run.
  • Added just directory to dev, containing modules argo, helm, and kubetail.
  • Added detailed comments to every recipe, using [doc] to support multiline comments.
  • Labeled all key sections and individual recipes with consistent formatting, with a minimum of 2 lines between recipes so that it's easy to distinguish without syntax highlighting.
  • Suppressed command printing in most commands using @ and summarized with echo statements.
  • Moved wait-for-* recipe calls into deploy recipes so that they are automatically called when a chart is deployed.
  • Adjusted all existing just calls in GH workflows accordingly.
  • Adjusted all paths in just recipes accordingly.
  • Reflected changes in READMEs

Testing

Manually tested all recipes (deploy::auctioneer and deploy::hyperlane-agents aren't working, but locally they didn't work before, either. I've added "FIXME" to each)

Changelogs

No updates required.

Related Issues

closes #1992

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
@github-actions github-actions bot added ci issues that are related to ci and github workflows sequencer-relayer pertaining to the astria-sequencer-relayer crate cd labels Feb 26, 2025
@ethanoroshiba ethanoroshiba added testing charts and removed ci issues that are related to ci and github workflows sequencer-relayer pertaining to the astria-sequencer-relayer crate cd labels Feb 26, 2025

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
@github-actions github-actions bot added ci issues that are related to ci and github workflows sequencer-relayer pertaining to the astria-sequencer-relayer crate cd labels Feb 26, 2025
@ethanoroshiba ethanoroshiba marked this pull request as ready for review February 26, 2025 16:59

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
Copy link
Contributor

@Fraser999 Fraser999 left a comment

Choose a reason for hiding this comment

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

Nice job - this makes things a great deal clearer.

Would be good to have newlines at the end of each file. I also generally prefer to not prefix usage examples with$ as it tends to make the commands harder to copy-paste.

Also, it would be nice to have a consistent approach to private recipes, either decorating with [private] or (my preference) prefixing the name with a leading underscore.

None of these things are blocking though!

charts/README.md Outdated
Copy link
Member

Choose a reason for hiding this comment

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

One note that the just files contained in here were fairly purposeful, as this whole folder including readme (as well as the dev folder) gets published separately to https://github.com/astriaorg/charts

We used to have a seperate charts/dev-cluster repo and combining them was meant to make it so devs could test locally easier, but still have a repo where a third party could pull and run with dev files.

We would want to get the appropriate chart related justfiles published appropriately there as well.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Added back to the charts directory in 4a8278e

Copy link
Contributor

@Fraser999 Fraser999 left a comment

Choose a reason for hiding this comment

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

This LGTM now, albeit there are still a few oddities which we probably have to live with (comment formatting, duplication of clean recipes as delete recipes).

@ethanoroshiba ethanoroshiba enabled auto-merge March 21, 2025 15:41
@ethanoroshiba ethanoroshiba disabled auto-merge March 21, 2025 15:41
Copy link
Member

@joroshiba joroshiba left a comment

Choose a reason for hiding this comment

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

Approved noting we will need a follow up PR to fix justfile in chart repo.

@ethanoroshiba ethanoroshiba added this pull request to the merge queue Mar 21, 2025
Merged via the queue into main with commit 9bac042 Mar 21, 2025
51 checks passed
@ethanoroshiba ethanoroshiba deleted the eoroshiba/just_comments branch March 21, 2025 16:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cd charts ci issues that are related to ci and github workflows sequencer-relayer pertaining to the astria-sequencer-relayer crate testing
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add just recipe comments
3 participants