Skip to content

feat: prevent incidental output breaking structured output#2005

Merged
mosteo merged 4 commits intoalire-project:masterfrom
Seb-MCaw:feat/pure-structured-output
Sep 6, 2025
Merged

feat: prevent incidental output breaking structured output#2005
mosteo merged 4 commits intoalire-project:masterfrom
Seb-MCaw:feat/pure-structured-output

Conversation

@Seb-MCaw
Copy link
Contributor

@Seb-MCaw Seb-MCaw commented Sep 4, 2025

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
  • A test is included, if required by the changes.
  • doc/user-changes.md has been updated, if there are user-visible changes.
  • doc/catalog-format-spec.md has been updated, if applicable.
  • BREAKING.md has been updated for major changes in alr, minor/major in catalog format.

@Seb-MCaw Seb-MCaw marked this pull request as ready for review September 4, 2025 17:02
Copilot AI review requested due to automatic review settings September 4, 2025 17:02
@Seb-MCaw
Copy link
Contributor Author

Seb-MCaw commented Sep 4, 2025

Ready for review, @mosteo.

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

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 --format is specified to prevent output pollution
  • Updates help text to clarify that --format implies -n and -q flags
  • 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 mosteo merged commit d8bc670 into alire-project:master Sep 6, 2025
59 of 62 checks passed
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>
@Seb-MCaw Seb-MCaw deleted the feat/pure-structured-output branch September 8, 2025 08:28
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>
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.

3 participants