Skip to content

add create command [AI]#1601

Open
rfbgo wants to merge 5 commits into
GoogleCloudPlatform:developfrom
rfbgo:create
Open

add create command [AI]#1601
rfbgo wants to merge 5 commits into
GoogleCloudPlatform:developfrom
rfbgo:create

Conversation

@rfbgo

@rfbgo rfbgo commented Jun 4, 2026

Copy link
Copy Markdown
Collaborator

No description provided.

@rfbgo rfbgo marked this pull request as draft June 4, 2026 15:28

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Code Review

This pull request introduces a new create command to Ramble, enabling users to generate application, modifier, and other object definitions either interactively or via the CLI. It includes the command-line interface, a creation backend, starter templates, bash completion updates, and unit tests. Feedback focuses on improving robustness and correctness: handling NoRepoConfiguredError when base class repositories are missing, preventing the interactive wizard from hanging in non-interactive environments, explicitly handling the 'builtin' repository fallback, ensuring consistent UTF-8 file encoding, correcting double curly brace escaping in templates to prevent formatting errors, and fixing a typo in the bash completion script.

Comment thread lib/ramble/ramble/cmd/create.py Outdated
Comment thread lib/ramble/ramble/creator.py Outdated
Comment thread share/ramble/templates/application.py.tpl Outdated
Comment thread share/ramble/templates/application.py.tpl Outdated
Comment thread lib/ramble/ramble/cmd/create.py
Comment thread lib/ramble/ramble/creator.py
Comment thread lib/ramble/ramble/creator.py
Comment thread share/ramble/ramble-completion.bash Outdated
@rfbgo rfbgo changed the title add create command add create command [AI] Jun 4, 2026
@ramble-pr-bot

ramble-pr-bot Bot commented Jun 4, 2026

Copy link
Copy Markdown

Ramble Performance Test Metrics

Results produced with commit: 3597362

Test Name Outcome Duration (s) Most Recent Run (s) Last 5 Avg (s)
test_analyze_large_file passed 2.9272 2.9922 (013099b) 2.9973
test_large_template_expansion passed 2.1550 2.1188 (013099b) 2.1363
test_many_experiments passed 33.5240 32.2892 (013099b) 33.2663
test_many_objects_defaults passed 18.6539 18.3797 (013099b) 18.4377
test_matrix_filter_perf passed 1.5767 1.5916 (013099b) 1.6218

@codecov

codecov Bot commented Jun 4, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 97.34748% with 10 lines in your changes missing coverage. Please review.
✅ Project coverage is 93.06%. Comparing base (013099b) to head (3597362).

Files with missing lines Patch % Lines
lib/ramble/ramble/cmd/create.py 91.22% 10 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff             @@
##           develop    #1601      +/-   ##
===========================================
+ Coverage    93.02%   93.06%   +0.04%     
===========================================
  Files          348      351       +3     
  Lines        33858    34232     +374     
===========================================
+ Hits         31497    31859     +362     
- Misses        2361     2373      +12     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@rfbgo rfbgo force-pushed the create branch 3 times, most recently from b81962a to 342a807 Compare June 8, 2026 18:52
@rfbgo rfbgo marked this pull request as ready for review June 9, 2026 23:41
@douglasjacobsen

Copy link
Copy Markdown
Collaborator

/gemini review

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Code Review

This pull request introduces a new create command in Ramble, allowing users to generate application, modifier, system, and other object definition stubs either via command-line arguments or an interactive wizard. It also updates bash completion, adds templates, fixes a completion typo, and updates package manager logic to evaluate conditional required packages. Feedback on these changes includes filtering out empty values from user-provided maintainers and tags, handling EOFError gracefully in the interactive wizard, setting the correct default base class for package managers, and safely retrieving the when clause in the user-managed package manager to avoid potential KeyErrors.

Comment thread lib/ramble/ramble/cmd/create.py
Comment thread lib/ramble/ramble/cmd/create.py
Comment thread lib/ramble/ramble/cmd/create.py
Comment thread lib/ramble/ramble/creator.py

@douglasjacobsen douglasjacobsen left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Thanks, this is great. I have a few comments, but otherwise it looks good.

)
subparser.add_argument(
"-r",
"--repo",

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

I wonder how hard it would be to support something like:

ramble create builtin.app.foo

And have the repo be picked (and the type) automatically from that.


def run_interactive_wizard():
"""Runs the step-by-step interactive wizard."""
print("\n" + "=" * 40)

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Does it make sense (I'm not sure...) for these to be logger calls instead of direct prints?

assert create_cmd.returncode in (None, 0)


def test_create_application_and_modifier(mutable_config, tmpdir):

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

I wonder if the create tests can either be parameterized, or just collapsed into a single one?

"type": ramble.keywords.key_type.required,
"level": ramble.keywords.output_level.variable,
for pkgname, config in obj.required_packages.items():
if app_inst.expander.satisfies(

Copy link
Copy Markdown
Collaborator

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 belongs in this PR, but this might be where you were running into this issue.

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.

2 participants