Skip to content

Conversation

@jortel
Copy link
Contributor

@jortel jortel commented Oct 8, 2025

fixes #923

Summary by CodeRabbit

  • New Features

    • Startup now logs the full application configuration in YAML with sensitive passphrases redacted, improving diagnostics and visibility.
  • Style

    • Reformatted the startup log into a single multi-line message for clearer, more readable output on launch.

@jortel jortel added this to the v0.8.1 milestone Oct 8, 2025
@coderabbitai
Copy link

coderabbitai bot commented Oct 8, 2025

Walkthrough

Startup logging now calls Settings.String() to produce a YAML-formatted, multi-line message. A new String() method on TackleSettings returns a YAML representation with Encryption.Passphrase redacted; it panics if YAML marshaling fails.

Changes

Cohort / File(s) Summary of changes
Startup logging
cmd/main.go
Replaced log.Info("Started", "settings", Settings) with log.Info("Started:\n" + Settings.String()) to log a single multi-line string.
Settings redaction utility
settings/all.go
Added import for gopkg.in/yaml.v2 and a new method func (r TackleSettings) String() (s string) that copies the struct, redacts Encryption.Passphrase to "********", marshals the copy to YAML, panics on marshal error, and returns the YAML string.

Sequence Diagram(s)

sequenceDiagram
  autonumber
  participant Main as main()
  participant S as TackleSettings.String()
  participant Y as yaml.Marshal
  participant L as Logger

  Main->>S: call String()
  activate S
  note right of S: copy settings\nset Encryption.Passphrase = "********"
  S->>Y: Marshal(copy)
  Y-->>S: YAML string or error
  alt marshal success
    S-->>Main: YAML string
  else marshal error
    S-->>Main: panic
  end
  deactivate S
  Main->>L: Info("Started:\n" + YAML)
  L-->>Main: logged
Loading

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Poem

I thump the logs with gentle care,
Secrets swaddled, hidden fair.
YAML hums in tidy rows,
Passphrases masked where nobody knows.
I hop away — the startup glows. 🐇✨

Pre-merge checks and finishing touches

✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title Check ✅ Passed The title succinctly captures the main change of ensuring that logged settings are redacted and directly corresponds to the added redaction logic and updated startup logging in the changeset.
Linked Issues Check ✅ Passed The changes introduce a String method that redacts sensitive fields on TackleSettings and update the startup log to use this method, fully satisfying the requirement from issue #923 to redact sensitive settings in logs.
Out of Scope Changes Check ✅ Passed All modifications are focused on implementing the redaction logic and updating the startup log to use the redacted String output; no unrelated or extraneous changes are present.
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%.
✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment

📜 Recent review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between be96181 and 8450ecf.

📒 Files selected for processing (1)
  • settings/all.go (2 hunks)
🚧 Files skipped from review as they are similar to previous changes (1)
  • settings/all.go

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@jortel jortel added cherry-pick/release-0.6 This PR should be cherry-picked to release-0.6 branch cherry-pick/release-0.7 This PR should be cherry-picked to release-0.7 branch cherry-pick/release-0.8 This PR should be cherry-picked to release-0.8 branch labels Oct 8, 2025
Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 84cd59e and 0037a7f.

📒 Files selected for processing (2)
  • assessment/membership.go (1 hunks)
  • settings/all.go (2 hunks)
🚧 Files skipped from review as they are similar to previous changes (1)
  • settings/all.go
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (3)
  • GitHub Check: test-unit
  • GitHub Check: vet
  • GitHub Check: build

@jortel
Copy link
Contributor Author

jortel commented Oct 8, 2025

@coderabbitai review

@coderabbitai
Copy link

coderabbitai bot commented Oct 8, 2025

✅ Actions performed

Review triggered.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@jortel
Copy link
Contributor Author

jortel commented Oct 8, 2025

@coderabbitai full review

@coderabbitai
Copy link

coderabbitai bot commented Oct 8, 2025

✅ Actions performed

Full review triggered.

@jortel jortel removed the cherry-pick/release-0.6 This PR should be cherry-picked to release-0.6 branch label Oct 8, 2025
@jortel
Copy link
Contributor Author

jortel commented Oct 8, 2025

@coderabbitai full review

@coderabbitai
Copy link

coderabbitai bot commented Oct 8, 2025

✅ Actions performed

Full review triggered.

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 3

📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between a7db576 and f23580e.

📒 Files selected for processing (2)
  • cmd/main.go (1 hunks)
  • settings/all.go (2 hunks)
🧰 Additional context used
🧠 Learnings (1)
📚 Learning: 2025-09-04T21:52:20.577Z
Learnt from: jortel
PR: konveyor/tackle2-hub#897
File: cmd/main.go:131-131
Timestamp: 2025-09-04T21:52:20.577Z
Learning: In the tackle2-hub project, the Settings struct in cmd/main.go does not contain secrets and all fields are useful for diagnostic logging during startup.

Applied to files:

  • cmd/main.go

jortel added 2 commits October 8, 2025 16:49
Signed-off-by: Jeff Ortel <[email protected]>
Signed-off-by: Jeff Ortel <[email protected]>
@jortel jortel merged commit 90b6515 into konveyor:main Oct 9, 2025
16 checks passed
github-actions bot pushed a commit that referenced this pull request Oct 9, 2025
fixes #923

<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->
## Summary by CodeRabbit

* **New Features**
* Startup now logs the full application configuration in YAML with
sensitive passphrases redacted, improving diagnostics and visibility.

* **Style**
* Reformatted the startup log into a single multi-line message for
clearer, more readable output on launch.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->

---------

Signed-off-by: Jeff Ortel <[email protected]>
Signed-off-by: Cherry Picker <[email protected]>
github-actions bot pushed a commit that referenced this pull request Oct 9, 2025
fixes #923

<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->
## Summary by CodeRabbit

* **New Features**
* Startup now logs the full application configuration in YAML with
sensitive passphrases redacted, improving diagnostics and visibility.

* **Style**
* Reformatted the startup log into a single multi-line message for
clearer, more readable output on launch.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->

---------

Signed-off-by: Jeff Ortel <[email protected]>
Signed-off-by: Cherry Picker <[email protected]>
jortel added a commit that referenced this pull request Oct 9, 2025
fixes #923

<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->
## Summary by CodeRabbit

* **New Features**
* Startup now logs the full application configuration in YAML with
sensitive passphrases redacted, improving diagnostics and visibility.

* **Style**
* Reformatted the startup log into a single multi-line message for
clearer, more readable output on launch.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->

---------

Signed-off-by: Jeff Ortel <[email protected]>
Signed-off-by: Cherry Picker <[email protected]>

Signed-off-by: Jeff Ortel <[email protected]>
Signed-off-by: Cherry Picker <[email protected]>
Co-authored-by: Jeff Ortel <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cherry-pick/release-0.7 This PR should be cherry-picked to release-0.7 branch cherry-pick/release-0.8 This PR should be cherry-picked to release-0.8 branch

Projects

None yet

Development

Successfully merging this pull request may close these issues.

🐛 Ensure logged settings are redacted.

3 participants