Skip to content

Add secret name validator coverage - #7745

Open
sfmskywalker wants to merge 4 commits into
mainfrom
codex/increase-secret-validator-coverage
Open

sfmskywalker wants to merge 4 commits into
mainfrom
codex/increase-secret-validator-coverage

Conversation

@sfmskywalker

Copy link
Copy Markdown
Member

Summary

  • add direct unit coverage for DefaultSecretNameValidator valid, invalid, trim, length, and normalization paths

Tests

  • dotnet test test/unit/Elsa.Secrets.UnitTests/Elsa.Secrets.UnitTests.csproj

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Adds focused unit tests for DefaultSecretNameValidator to exercise expected valid/invalid name handling, trimming behavior, maximum length enforcement, and normalization behavior within the Elsa Secrets module.

Changes:

  • Introduces unit tests covering valid and invalid secret name formats and required-name behavior.
  • Adds coverage for trimming behavior during validation.
  • Adds coverage for name normalization (trim + lowercase).

Comment on lines +56 to +65
[Fact]
public void IsValid_RejectsNamesLongerThanTwoHundredCharacters()
{
var name = $"a{new string('b', 200)}";

var isValid = _validator.IsValid(name, out var error);

Assert.False(isValid);
Assert.NotNull(error);
}
@greptile-apps

greptile-apps Bot commented Jun 20, 2026

Copy link
Copy Markdown
Contributor

Greptile Summary

Adds direct unit coverage for DefaultSecretNameValidator. Covers valid and invalid secret names, missing names, trimming, maximum length, and normalization behavior.

Confidence Score: 5/5

The change is limited to unit test coverage for the secret name validator and does not modify production behavior.

The touched file adds focused tests for validation outcomes, trimming, length handling, and normalization paths described by the change.

T-Rex T-Rex Logs

What T-Rex did

  • The base revision showed a command execution attempt in the test environment and ended with exit code 127 due to dotnet: command not found.
  • The head revision showed a command execution attempt in the test environment and ended with exit code 127 due to dotnet: command not found.
  • Source inspection confirmed that the head test file declares the expected test methods, but proof execution could not proceed because the runtime was missing.

View all artifacts

T-Rex Ran code and verified through T-Rex

Reviews (3): Last reviewed commit: "Merge branch 'main' into codex/increase-..." | Re-trigger Greptile

@sfmskywalker
sfmskywalker requested a review from Copilot June 20, 2026 02:08
@sfmskywalker

Copy link
Copy Markdown
Member Author

Handled Copilot inline comment #7745 (comment). Direct inline reply failed with GitHub API 404, so replying here instead: addressed in 3a70511 by asserting both the accepted 200-character boundary and rejected 201-character boundary. Validated with dotnet test test/unit/Elsa.Secrets.UnitTests/Elsa.Secrets.UnitTests.csproj.

@sfmskywalker

Copy link
Copy Markdown
Member Author

Follow-up for Copilot inline comment #7745 (comment): also addressed the exact error-message assertion in 4a7abf3. The boundary test now accepts 200 characters, rejects 201 characters, and asserts the shared format error. Validation: dotnet test test/unit/Elsa.Secrets.UnitTests/Elsa.Secrets.UnitTests.csproj.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 1 out of 1 changed files in this pull request and generated no new comments.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 1 out of 1 changed files in this pull request and generated no new comments.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants