← Back to issue list

Refactor YAML Generation and Schema Models for Optional Summary Support

View original Github issue

Metadata

Project
snapcraft
Number
#5472
Type
pull request
State
closed
Author
RepoBirdBot
Labels
—
Created
Updated
Closed

Current evaluation

Closed unmerged and superseded by canonical/snapcraft#5501 (commit 9d7a82a19), which added optional confdb-schema summary fields and tests for issue #5442.

Resolution: closed superseded

Reason: PR #5472 was not merged. Its optional-summary and schema-generation work was superseded by canonical/snapcraft#5501, merged as commit 9d7a82a19, which added the support and tests and resolved #5442.

Evaluated by: mr-cal-bot

No scores available.

Issue body

This pull request makes several improvements and refactorings to enhance the handling of optional `summary` fields and overall schema generation in Snapcraft. ### Key Changes - **Dependency Updates:** - Updated `pyproject.toml` by replacing the `[project.optional-dependencies]` section with `[dependency-groups]`. - Removed the `keyring` dependency from the development packages. - **Schema Model Adjustments:** - Refactored the `ConfdbSchema` and related assertion models by removing explicit `summary` fields. This change ensures that optional summaries are only applied if necessary, aligning with updated specification expectations. - Removed the `Rules` export from the models where it was no longer needed, simplifying the API surface. - **YAML Generation Enhancements:** - Updated the YAML generation logic in the confdb schemas service to use a new template (`_CONFDB_SCHEMA_TEMPLATE`) for assembling YAML content. This refactoring includes support for ordered keys and a more concise representation of summary fields when present. - Replaced the use of a custom PyYAML dumper with `dump_yaml` from the existing utility module to achieve consistent formatting and key ordering. - **Test Suite Updates:** - Adjusted and simplified tests in `tests/unit/models/test_assertions.py` and `tests/unit/services/test_confdbs.py` to reflect the removal of explicit summary fields from models. - Ensured that marshalling functions correctly cast scalars to strings, consistent with the expected behavior. ### Impact These changes improve the clarity of the codebase and align the schema models with the updated specifications. Additionally, the updated YAML generation produces cleaner output that handles optional fields gracefully. All modifications adhere to the existing code style and have been validated with the full test suite to ensure no regressions occur. Please review the changes and provide any feedback or suggestions for further improvements. --- *Created with [Repobird.ai](https://repobird.ai) 📦🐦*

Evaluation history

Date Model Scores Action Summary
stealth/space-bunny-alpha — closed superseded Closed unmerged and superseded by canonical/snapcraft#5501 (commit 9d7a82a19), which added optional confdb-schema summary fields and tests for issue #5442.
stealth/space-bunny-alpha — closed superseded Closed unmerged and superseded by #5501 (9d7a82a19), which added optional confdb-schema summary fields and tests for #5442.
stealth/space-bunny-alpha — closed superseded Closed unmerged and superseded by PR #5501 (commit 9d7a82a19), which added optional confdb-schema summary fields and tests.
qwen/qwen3.6-35b-a3b — — Closed and abandoned without review or merge. The automated contribution proposed YAML and schema refactoring but received no maintainer feedback, leading to its closure.
qwen3.6-35b-a3b-mtp-q6 — — Closed without merging. The automated contribution from RepoBird.ai addressing issue #5442 was rejected. Changes were not integrated into the codebase.

Update history

No update history recorded yet.

Related work

  • Superseded By: canonical/snapcraft#5501 (confidence 100%)

    Merged PR #5501 replaced the unmerged implementation with optional confdb-schema summary support and tests.

  • Related To: canonical/snapcraft#5442 (confidence 100%)

    Both PRs addressed optional summary fields in confdb-schema assertions; #5501 closed the underlying issue.

Related issues

Issue Project State Summary Similarity
#5442 Support "summary" fields in the confdb-schema assertion snapcraft closed Optional top-level and per-view summaries were added by merged PR canonical/snapcraft#5501 (commit 9d7a82a19) and documented in Snapcraft 8.10.
75%
#5501 feat(confdb-schema): support optional summary fields snapcraft merged PR #5501 was merged as commit 9d7a82a19, adding optional confdb-schema summary fields at the top level and per view, with unit tests; it fixes #5442.
73%
#2446 Update schema/snapcraft.yaml snapcraft closed PR #2446 edited schema/snapcraft.yaml to aid yaml-to-json converters but was closed unmerged in favour of #2448, which replaced the YAML schema with snapcraft.json (commit 2a2f798d0).
71%