Skip to content

Conversation

Akshay2191
Copy link
Contributor

Implemented a function to validate the label value against regex to align it with N1C.

Checklist

Before creating a PR, run through this checklist and mark each as complete.

  • I have read the CONTRIBUTING document
  • I have run make install-tools and have attached any dependency changes to this pull request
  • If applicable, I have added tests that prove my fix is effective or that my feature works
  • If applicable, I have checked that any relevant tests pass after adding my changes
  • If applicable, I have updated any relevant documentation (README.md)
  • If applicable, I have tested my cross-platform changes on Ubuntu 22, Redhat 8, SUSE 15 and FreeBSD 13

@Akshay2191 Akshay2191 requested a review from a team as a code owner October 16, 2025 14:56
@github-actions github-actions bot added the chore Pull requests for routine tasks label Oct 16, 2025
Copy link

codecov bot commented Oct 16, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 84.89%. Comparing base (383ce95) to head (3f71582).

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1345      +/-   ##
==========================================
+ Coverage   84.88%   84.89%   +0.01%     
==========================================
  Files         100      100              
  Lines       14520    14530      +10     
==========================================
+ Hits        12325    12335      +10     
  Misses       1734     1734              
  Partials      461      461              
Files with missing lines Coverage Δ
internal/config/config.go 85.69% <100.00%> (+0.11%) ⬆️

Continue to review full report in Codecov by Sentry.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 383ce95...3f71582. Read the comment docs.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@Akshay2191 Akshay2191 requested a review from sean-breen October 16, 2025 18:40
@Akshay2191 Akshay2191 self-assigned this Oct 17, 2025

labels:
label1: label 1
label1: label-1
Copy link
Contributor

Choose a reason for hiding this comment

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

Why the change in the label, will spaces no longer be allowed ?

Copy link
Collaborator

Choose a reason for hiding this comment

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

yeah thats correct. We are enforcing more strict rules on what values labels can have.

const maxLength = 256
labelPattern := regexp.MustCompile(regexLabelPattern)
if len(labelValue) > maxLength || !labelPattern.MatchString(labelValue) {
slog.Warn("Label value contains unsupported character ", "label_value", labelValue)
Copy link
Contributor

Choose a reason for hiding this comment

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

The reason for failure here could be that the label is too long, could this message me updated to mention that too

tests := []struct {
name string
input string
wantValid bool
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
wantValid bool
expected bool


for _, tt := range tests {
t.Run(tt.name, func(t *testing.T) {
got := validateLabel(tt.input)
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
got := validateLabel(tt.input)
actual := validateLabel(tt.input)

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

Labels

chore Pull requests for routine tasks

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants