Skip to content

TO-299: move match artefact to queries.py#661

Merged
almeidaraul merged 10 commits intomainfrom
TO-299/match-rules-in-data-access
Mar 26, 2026
Merged

TO-299: move match artefact to queries.py#661
almeidaraul merged 10 commits intomainfrom
TO-299/match-rules-in-data-access

Conversation

@almeidaraul
Copy link
Copy Markdown
Contributor

Description

Matching AMRs to artefacts was not centralized/coupled to the AMR model. Now it is part of data_access.

Resolved issues

This is part of TO-299

Documentation

No changes

Web service API changes

No changes

Tests

No changes to test, they all pass

Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Moves artefact-to-matching-rule selection logic out of the test execution controller and into data_access so reviewer assignment can reuse centralized query-building.

Changes:

  • Added match_artefact() SQLAlchemy query helper to select the most specific ArtefactMatchingRule(s) for an Artefact.
  • Refactored reviewer assignment in start_test.py to call match_artefact() and fetch matching teams/users via rule IDs.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 3 comments.

File Description
backend/test_observer/data_access/queries.py Introduces a reusable query helper to select the most specific matching-rule IDs for an artefact.
backend/test_observer/controllers/test_executions/start_test.py Replaces in-controller matching-rule filtering/sorting with the centralized match_artefact() query.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@rpbritton rpbritton self-requested a review March 25, 2026 17:53
Copy link
Copy Markdown
Collaborator

@wctaylor wctaylor left a comment

Choose a reason for hiding this comment

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

Looks pretty solid! Just a few minor changes I'd like to see

@almeidaraul almeidaraul merged commit 04cc0bd into main Mar 26, 2026
6 checks passed
@almeidaraul almeidaraul deleted the TO-299/match-rules-in-data-access branch March 26, 2026 18:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants