Repository navigation
Keep TAGS.md topics within GitHub's rules so one bad tag cannot block the update - #226
Merged
Merged
Conversation
… the update GitHub replaces a repository's topics in one PUT and rejects the whole set when it holds more than 20 entries or a topic that does not start with a letter or digit. TagsParser now trims leading and trailing hyphens, drops topics left empty, and keeps the first 20, warning with the names of any it drops. The 422 on the PUT stays non-fatal. Fixes #170 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01CzB8uCZc7DWCamHvE3Qk4k
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.



Fixes #170
What changed
GitHubServicereplaces a repository's topics with a singlePUT. GitHub rejects the whole set if there are more than 20 topics, or if any topic doesn't start with a letter or digit. When that happened the repository kept stale topics and the run only logged a warning. This follows the maintainer decision on the issue:TagsParser.Parsenow trims leading and trailing-from each topic and drops any topic that ends up empty.-foobecomesfoo, and---is removed.Distinct(), it keeps the first 20 topics (TagsParser.MaxTopics).Parse(content, IBuildLogger?)andParseAsync(path, IBuildLogger?, ct)log a warning that names the dropped topics.PipelineServicepasses its logger through. The existing overloads are unchanged and simply forward with no logger, so the public API stays binary-compatible.PUTstill doesn't fail the run.Tests
Seven new
TagsParserTests:tag21, tag22.^[a-z0-9][a-z0-9-]{0,49}$.To check that the tests catch the bug, I removed the trim and the cap from the fixed code. Four of the new tests then failed: the limit test, both hyphen tests, and the regex guard. The full suite passes (771 tests). The local Sonar build reports nothing new in the changed files; its one
PipelineServicehit, S2325 at line 421, was already there.🤖 Generated with Claude Code
https://claude.ai/code/session_01CzB8uCZc7DWCamHvE3Qk4k
Generated by Claude Code