feat: prevent incidental output breaking structured output#2005
Merged
mosteo merged 4 commits intoalire-project:masterfrom Sep 6, 2025
Merged
feat: prevent incidental output breaking structured output#2005mosteo merged 4 commits intoalire-project:masterfrom
mosteo merged 4 commits intoalire-project:masterfrom
Conversation
Contributor
Author
|
Ready for review, @mosteo. |
Contributor
There was a problem hiding this comment.
Pull Request Overview
This PR prevents incidental output from breaking structured output formats (JSON, TOML, YAML) by automatically enabling silent mode when structured output is requested. This ensures that warnings, prompts, and other messages don't interfere with parsable output.
- Automatically enables silent mode when
--formatis specified to prevent output pollution - Updates help text to clarify that
--formatimplies-nand-qflags - Adds comprehensive test coverage for scenarios where warnings and toolchain assistant messages could break structured output
Reviewed Changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| src/alr/alr-commands.adb | Implements silent mode activation for structured output and updates help text |
| testsuite/tests/misc/structured-output-always-quiet/test.py | Test verifying that structured output remains parsable despite warnings and prompts |
| testsuite/tests/misc/structured-output-always-quiet/test.yaml | Test configuration file |
| testsuite/tests/misc/structured-output-always-quiet/outdated_index/index/index.toml | Test fixture for triggering index version warnings |
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
mosteo
approved these changes
Sep 6, 2025
mosteo
pushed a commit
that referenced
this pull request
Sep 6, 2025
* Add test * Fix incidental output breaking structured output * Add note to `--format`'s description * Fix typo in test comment Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> --------- Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Lucretia
pushed a commit
to Lucretia/alire
that referenced
this pull request
Sep 13, 2025
…ject#2005) * Add test * Fix incidental output breaking structured output * Add note to `--format`'s description * Fix typo in test comment Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> --------- Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
mosteo
added a commit
that referenced
this pull request
Dec 5, 2025
* Add Gentoo and Portage into the platforms and package managers. * Add a new package to support portage on Gentoo. * Hook in Gentoo/Portage into the Deployers * dev: check templates are up to date (#1995) * dev: check templates are up to date * Touch template * Better feedback * Restore touched template * dev: guidelines for automatic Copilot reviews (#1998) * dev: instructions for copilot reviews * Add info about testing * fix: pass GH token in Docker tests too (#1999) * dev: placeholder for ignoring known future properties (#2000) * Minimal spec for future property * Implementation & Test * Do not leak hidden property * fix: typos in `catalog-format-spec.md` (#2002) * fix: workflow on aarch64 linux, macOS 14 instead of latest (#2003) * attempt fixing workflow on aarch64 linux * dev: force macOS 14 macos-latest runner is now macOS 15 which breaks things, yet to diagnose... * fix: force macOS 14 in `ci-toolchain.yml` * dev: remove custom aarch case from `ci-release.yml` * Revert "dev: remove custom aarch case from `ci-release.yml`" This reverts commit 069997e. --------- Co-authored-by: Alejandro R Mosteo <amosteo@unizar.es> * feat: prevent incidental output breaking structured output (#2005) * Add test * Fix incidental output breaking structured output * Add note to `--format`'s description * Fix typo in test comment Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> --------- Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> * Add documentation for Gentoo. * Simplify the expression. * Fix indexing error. Check to make sure we have a line to check before checking the line. * feat: validation of GH PATs (#1994) * feat: minimal vetting of GH PATs * Old check when forcing * Correct the package manager's name to emerge. * Change the log level to Detail. * Change Info -> Debug. * Add the comment box. * Bump den dependency * Downgrade level of some logs --------- Co-authored-by: Alejandro R Mosteo <amosteo@unizar.es> Co-authored-by: Manuel <mgrojo@gmail.com> Co-authored-by: César Sagaert <aldantanneo@gmail.com> Co-authored-by: Seb M'Caw <mcaw@adacore.com> Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Similarly to #1866, structured output is sometimes preceded by additional prompts or messages, making it unparsable.
This PR silences such output in the same way as #1868.
PR creation checklist
doc/user-changes.mdhas been updated, if there are user-visible changes.doc/catalog-format-spec.mdhas been updated, if applicable.BREAKING.mdhas been updated for major changes inalr, minor/major in catalog format.