Repository navigation
feat(graph): limit the length of tags - #4017
Conversation
Up to standards ✅🟢 Issues
|
| Metric | Results |
|---|---|
| Complexity | 18 |
🟢 Coverage 53.85% diff coverage · +0.03% coverage variation
Metric Results Coverage variation ✅ +0.03% coverage variation (-1.00%) Diff coverage ✅ 53.85% diff coverage Coverage variation details
Coverable lines Covered lines Coverage Common ancestor commit (f35dcd5) 94253 28225 29.95% Head commit (a359ef7) 94265 (+12) 28257 (+32) 29.98% (+0.03%) Coverage variation is the difference between the coverage for the head and common ancestor commits of the pull request branch:
<coverage of head commit> - <coverage of common ancestor commit>Diff coverage details
Coverable lines Covered lines Diff coverage Pull request (#4017) 13 7 53.85% Diff coverage is the percentage of lines that are covered by tests out of the coverable lines that the pull request added or modified:
<covered lines added or modified>/<coverable lines added or modified> * 100%
NEW Get contextual insights on your PRs based on Codacy's metrics, along with PR and Jira context, without leaving GitHub. Enable AI reviewer
TIP This summary will be updated as you push new changes.
asaah262
left a comment
There was a problem hiding this comment.
Thanks, looks good and the tests are clear! Just needs a rebase. The "reva bump" and "Behaviour change" parts of the description then no longer apply, since main already trims tags.
Tags could be of any length. Assigning tags through the graph API now rejects the whole request with 400 if one of the tags is longer than the maximum, listing the tags that are too long. The length is counted in characters, after the whitespace around each tag is removed. Tags that already exist are not affected. The maximum is 100 characters by default, and can be changed with OC_MAX_TAG_LENGTH, or turned off with 0. The frontend service announces it to clients as the graph.tags.max_tag_length capability, so that they can check tags before sending them. Both services read the same variable, without a service-specific alias, so that the announced limit is always the one graph enforces. Assisted-by: Claude Code:claude-opus-5-5
c584c07 to
a359ef7
Compare
|
Thanks, rebased onto main. The reva bump commit is gone, since v3.0.1 already has the validation and the capability, and I removed the two outdated parts of the description. |
asaah262
left a comment
There was a problem hiding this comment.
Thanks for the changes.
Tags could be of any length. Assigning tags through the graph API now rejects the request with 400 when a tag is longer than the maximum, 100 characters by default. Clients learn the limit from the new
graph.tags.max_tag_lengthcapability.Changes
AssignTagschecks the tags with reva'stags.MaxLengthValidatorbefore storing them. If one tag is too long, nothing is stored, and the error lists the tags that are too long. The length is counted in characters, after trimming the whitespace around each tag. Tags that already exist are not affected.OC_MAX_TAG_LENGTH(default 100, 0 turns the limit off). The graph and frontend services both read it, without a service-specific alias, so that the announced limit is always the one graph enforces.graph.tags.max_tag_length.Tests
apiSpaces/tag.feature: a tag of 101 characters is rejected, one of 100 is stored.AI assistance: Claude Code (claude-opus-5-5) wrote the code and the tests, and the first draft of this description; I reviewed them.