Skip to content

refactor: Convert CodeCovSettings from class to record#1719

Merged
thomhurst merged 1 commit into
mainfrom
fix/codecov-settings-record
Jan 1, 2026
Merged

refactor: Convert CodeCovSettings from class to record#1719
thomhurst merged 1 commit into
mainfrom
fix/codecov-settings-record

Conversation

@thomhurst
Copy link
Copy Markdown
Owner

Summary

  • Converts CodeCovSettings from class to record for consistency with other settings
  • Adds [SecretValue] attribute to Token property to match the pattern in other settings

Context

All other settings classes in the build pipeline use record:

  • CodacySettings - record with [SecretValue] on Token
  • GitHubSettings - record
  • NuGetSettings - record with [SecretValue] on ApiKey
  • PublishSettings - record

CodeCovSettings was the only one using class, creating an inconsistency.

Test plan

  • CI pipeline passes

Fixes #1546

🤖 Generated with Claude Code

Convert CodeCovSettings to a record for consistency with other settings
classes (CodacySettings, GitHubSettings, NuGetSettings, PublishSettings).
Also adds [SecretValue] attribute to Token property to match the pattern
used by other settings that contain sensitive values.

Fixes #1546

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Copilot AI review requested due to automatic review settings January 1, 2026 16:55
@thomhurst
Copy link
Copy Markdown
Owner Author

Summary

Adds [SecretValue] attribute to CodeCov token and converts class to record for consistency.

Critical Issues

None found ✅

Suggestions

None - the changes align perfectly with existing patterns in the codebase (GitHubSettings, CodacySettings, NuGetSettings all use record with [SecretValue] on token/API key properties).

Verdict

APPROVE - No critical issues

The PR correctly:

  • Protects sensitive token from being logged via [SecretValue] attribute (security improvement)
  • Converts to record for consistency with other settings classes in the same directory
  • Adds missing trailing newline

Copy link
Copy Markdown

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 refactors CodeCovSettings from a class to a record for consistency with other settings classes in the build pipeline. It also adds the [SecretValue] attribute to the Token property to ensure proper handling of sensitive data, matching the pattern used in CodacySettings, GitHubSettings, and NuGetSettings.

Key Changes:

  • Converted CodeCovSettings from class to record
  • Added [SecretValue] attribute to the Token property
  • Added required using ModularPipelines.Attributes; directive

@thomhurst thomhurst merged commit 22b9325 into main Jan 1, 2026
17 of 18 checks passed
@thomhurst thomhurst deleted the fix/codecov-settings-record branch January 1, 2026 17:09
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.

Code smell: Inconsistent record vs class usage in Settings

2 participants