Skip to content

Conversation

@theory
Copy link
Member

@theory theory commented Mar 25, 2025

Add extensive info, debug, and trace logging throughout. The CLI will style and emit log messages at the INFO level or higher.

Upgrade pgxn_meta to v0.6.0 and add a test to the API to ensure it can properly handle Meta API requests to api.pgxn.org, which adds fields supported by pgxn_meta v0.6.0.

Add the lines module, which defines a trait, line::WriteLine, for writing lines of text. It also defines two implementations: LineWriter, which simply writes lines to a std::io::Write, and ColorLine, which uses an owo_colors::Style to style a line before writing it to a std::io::Write. Use LineWriter to capture output during tests, so it doesn't appear in test output. Hopefully we'll also eventually be able to test that output, but for now ownership rules prevent it.

Add the exec module to set the directory context for the execution of a command and to stream its STDOUT and STDERR output to lines::WriteLine values. This allows for the styling and capturing of output.

Import the api and pg_config modules instead of making them directly public.

Remove the generics and lifetimes from most structs. This greatly simplifies building structs from other structs, and allows the exec::Executor to be passed to Pipeline constructors instead of a directory. This allows the module to set up the default execution output streaming, styling STDOUT in light grey and STDERR in red by streaming them to line::ColorLine structs that wrap our STDOUT and STDERR. Ultimately this configuration may move to consumers.

For better or worse, the need for the line writers to be mutable requires that the Pipelines be mutable, too.

@theory theory requested a review from vrmiguel March 25, 2025 22:00
@theory theory self-assigned this Mar 25, 2025
@codecov
Copy link

codecov bot commented Mar 25, 2025

Codecov Report

Attention: Patch coverage is 92.70073% with 10 lines in your changes missing coverage. Please review.

Project coverage is 96.91%. Comparing base (471396e) to head (0f7ea0b).
Report is 1 commits behind head on main.

Files with missing lines Patch % Lines
src/lib.rs 81.25% 9 Missing ⚠️
src/api/mod.rs 95.45% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main      #24      +/-   ##
==========================================
- Coverage   98.19%   96.91%   -1.28%     
==========================================
  Files          10       12       +2     
  Lines         499      584      +85     
==========================================
+ Hits          490      566      +76     
- Misses          9       18       +9     

☔ View full report in Codecov by Sentry.
📢 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.

Add extensive info, debug, and trace logging throughout. The CLI will
style and emit log messages at the INFO level or higher.

Upgrade pgxn_meta to v0.6.0 and add a test to the API to ensure it can
properly handle Meta API requests to api.pgxn.org, which adds fields
supported by pgxn_meta v0.6.0.

Add the `lines` module, which defines a trait, `line::WriteLine`, for
writing lines of text. It also defines two implementations:
`LineWriter`, which simply writes lines to a `std::io::Write`, and
`ColorLine`, which uses an `owo_colors::Style` to style a line before
writing it to a `std::io::Write`. Use `LineWriter` to capture output
during tests, so it doesn't appear in test output. Hopefully we'll also
eventually be able to test that output, but for now ownership rules
prevent it.

Add the `exec` module to set the directory context for the execution of
a command and to stream its STDOUT and STDERR output to
`lines::WriteLine` values. This allows for the styling and capturing of
output.

Import the `api` and `pg_config` modules instead of making them directly
public.

Remove the generics and lifetimes from most structs. This greatly
simplifies building structs from other structs, and allows the
`exec::Executor` to be passed to Pipeline constructors instead of a
directory. This allows the module to set up the default execution output
streaming, styling STDOUT in light grey and STDERR in red by streaming
them to `line::ColorLine` structs that wrap our STDOUT and STDERR.
Ultimately this configuration may move to consumers.

For better or worse, the need for the line writers to be mutable
requires that the Pipelines be mutable, too.
@theory theory merged commit 0f7ea0b into main Mar 26, 2025
12 of 14 checks passed
@theory theory deleted the show-output branch March 26, 2025 00:26
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