Skip to content

DRY repo schema - #1733

Merged
douglasjacobsen merged 2 commits into
GoogleCloudPlatform:developfrom
rfbgo:repo_schema_dedup
Aug 21, 2026
Merged

DRY repo schema#1733
douglasjacobsen merged 2 commits into
GoogleCloudPlatform:developfrom
rfbgo:repo_schema_dedup

Conversation

@rfbgo

@rfbgo rfbgo commented Aug 20, 2026

Copy link
Copy Markdown
Collaborator

In a different conversation gemini notes that ramble.schema.base_utility_repos.properties and ramble.schema.utility_repos.properties were (unintentionally?) missing from the repo import. That sent me down a side quest to see if I could DRY some of the repeated schema/properties code

Some things are repeated in almost every file, such as:

properties = {
    "<name>": {
        "type": "array",
        "default": [],
        "items": {"type": "string"},
    },

@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 refactors the schema definitions in Ramble by consolidating duplicate repository schema definitions into a helper module ramble.schema.repo_schema and dynamically importing submodules in ramble.schema/__init__.py. Feedback is provided regarding the dynamic import in __getattr__, where catching any ModuleNotFoundError can mask internal import errors of submodules. It is recommended to verify that the error name matches the target module before raising an AttributeError.

Comment thread lib/ramble/ramble/schema/__init__.py Outdated
@rfbgo
rfbgo force-pushed the repo_schema_dedup branch from 5ae919f to 52ba843 Compare August 20, 2026 16:18
Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
@ramble-pr-bot

ramble-pr-bot Bot commented Aug 20, 2026

Copy link
Copy Markdown

Ramble Performance Test Metrics

Results produced with commit: 3847e9f

Test Name Outcome Duration (s) Most Recent Run (s) Last 5 Avg (s)
test_analyze_large_file passed 2.1244 2.0909 (185471f) 2.0958
test_large_template_expansion passed 1.2448 1.1892 (185471f) 1.3997
test_many_experiments passed 26.4927 23.2019 (185471f) 24.5554
test_many_objects_defaults passed 14.8575 13.1219 (185471f) 13.6278
test_matrix_filter_perf passed 1.1914 1.0546 (185471f) 1.1271

@codecov

codecov Bot commented Aug 20, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 96.58120% with 4 lines in your changes missing coverage. Please review.
✅ Project coverage is 94.02%. Comparing base (185471f) to head (3847e9f).

Files with missing lines Patch % Lines
lib/ramble/ramble/schema/__init__.py 50.00% 4 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff             @@
##           develop    #1733      +/-   ##
===========================================
- Coverage    94.02%   94.02%   -0.01%     
===========================================
  Files          367      369       +2     
  Lines        36933    36991      +58     
===========================================
+ Hits         34728    34782      +54     
- Misses        2205     2209       +4     

☔ 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.

@douglasjacobsen
douglasjacobsen merged commit 225b8bb into GoogleCloudPlatform:develop Aug 21, 2026
30 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.

2 participants