docs: Update CONVENTIONS.md file#2366
Conversation
Reviewer's GuideUpdates CONVENTIONS.md to add detailed performance, database, and API design anti-pattern conventions derived from ADR-00018, and refines observability guidance including tracing scope and migration from log:: to tracing::. Flow diagram for instrumentation scope conventionsflowchart TD
A[Function_or_call_site] --> B{Performs_external_IO?}
B -- No --> C[Do_not_instrument]
B -- Yes --> D{Callee_has_instrument_attribute?}
D -- Yes --> E[Do_not_add_dot_instrument_at_call_site]
D -- No --> F[Wrap_await_with_dot_instrument_info_span]
F --> G{Multiple_distinct_external_steps?}
G -- Yes --> H[Use_nested_spans_for_each_external_step]
G -- No --> I[Single_span_covers_operation]
A --> J{Pure_in_memory_trivial_work?}
J -- Yes --> C
J -- No --> B
Flow diagram for logging framework migration conventionsflowchart TD
A[Editing_Rust_source_file] --> B{File_uses_log_macros?}
B -- Yes --> C[Migrate_log_macros_to_tracing_macros_in_same_change]
B -- No --> D{Adding_new_logging?}
D -- Yes --> E[Use_tracing_macros_only]
D -- No --> F[No_logging_changes]
C --> G[All_logging_now_uses_tracing]
E --> G
File-Level Changes
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
mrizzi
left a comment
There was a problem hiding this comment.
I can see nothing about the *Creator pattern for data management as the one to be used and implemented.
For example the PurlStatusCreator I had to introduce in #2080.
The "forbidden" pattern is the *Context one that, if and where still used, should be, at this point, replaced by the *Creator pattern to fix the tech debt.
For example ProductContext.
@mrrajan I think it could be useful if you could run an agent against code and discussion in #2080 itself to derive the appropriate code conventions.
ctron
left a comment
There was a problem hiding this comment.
A few minor things. In general it's ok to merge. But I'll leave that button for someone else to press.
- Add Addional conventions to the CONVENTIONS.md file with reference to ADR 00018 Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
316cf0c to
54c48b0
Compare
Reference PR - #2358
JIRA - https://redhat.atlassian.net/browse/TC-4289
Preview - https://github.com/mrrajan/trustify/blob/TC-4289-convention/CONVENTIONS.md
Summary by Sourcery
Expand and refine engineering conventions around observability and database usage, incorporating anti-pattern guidance and schema best practices into CONVENTIONS.md.
Documentation: