Validate jira ticket reason for manifest declarations in the parser to improve error clarity - #7422
Validate jira ticket reason for manifest declarations in the parser to improve error clarity#7422nccatoni wants to merge 2 commits into
Conversation
…o improve error clarity
|
|
|
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 540cfb096a
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| if elements[1]: | ||
| self.reason = skip_declaration[1] | ||
| self.value, self.reason = _parse_skip_declaration(self.raw) | ||
| validate_declaration_reason(self.value, self.reason) |
There was a problem hiding this comment.
Update the now-invalid agent manifest fixture
When Test_ComputeLibrariesAndScenarios.test_manifest_agent constructs Inputs, it parses tests/test_the_test/manifests/manifests_agent_edit/agent.yml, whose Test_SamplingRates entry is still the bare declaration bug. This new validation therefore raises ValueError before the test assertions, breaking that test and its CI suite; update the fixture to include a valid JIRA ticket alongside enforcing this invariant.
AGENTS.md reference: AGENTS.md:L33-L35
Useful? React with 👍 / 👎.
| import re | ||
|
|
||
|
|
||
| _jira_ticket_pattern = re.compile(r"([A-Z]{3,}-\d+)(, [A-Z]{3,}-\d+)*") |
There was a problem hiding this comment.
Accept short Jira project keys
When a valid ticket has a one- or two-letter project key, such as AI-123, this pattern rejects the manifest with ValueError because it requires at least three letters. The repository's existing Jira validators and ticket-labeling script both define the accepted key as [A-Z]+-\d+ (tests/schemas/utils/schemas_validators.py and utils/scripts/add-system-tests-label-on-known-tickets.py), so this new parser check should use the same format rather than preventing otherwise valid bug and flaky declarations.
AGENTS.md reference: AGENTS.md:L24-L24
Useful? React with 👍 / 👎.
Motivation
Changes
Workflow
🚀 Once your PR is reviewed and the CI green, you can merge it!
🛟 #apm-shared-testing 🛟
Reviewer checklist
tests/ormanifests/is modified ? I have the approval from R&P teambuild-XXX-imagelabel is present