Skip to content

feat: add external site id to agents#368

Open
RadovanTomik wants to merge 3 commits intomasterfrom
feat/site_id
Open

feat: add external site id to agents#368
RadovanTomik wants to merge 3 commits intomasterfrom
feat/site_id

Conversation

@RadovanTomik
Copy link
Copy Markdown
Member

Pull Request:

Description:

This pull request introduces support for an external identifier for agents throughout the backend and frontend. The main changes include updates to the database schema, backend models, DTOs, and API logic, as well as enhancements to the frontend to display and edit the external identifier. It also adds a dedicated agent detail view and improves routing and test coverage.

Backend changes:

  • Added externalIdentifier field to the Agent entity, DTOs (AgentDTO, AgentUpdateRequest), and included it in equality and hash code logic. [1] [2] [3] [4] [5] [6] [7]
  • Updated the database schema to add the external_identifier column to the agent table.
  • Modified AgentServiceImpl to allow updating the external identifier via the API.

Frontend changes:

  • Added a new AgentDetailView.vue component for viewing and editing agent details, including the external identifier.
  • Updated router configuration to support /agents/:id for the agent detail view and adjusted routes for agent reports and interactions. [1] [2] [3] [4]
  • Enhanced AgentReportView.vue to include a button linking to the agent detail view and improved navigation logic. [1] [2] [3]

Testing:

  • Added integration tests to verify updating and retrieving the external identifier for agents.
  • Refactored test setup to use the @IntegrationTest annotation for improved consistency.

Checklist:

Make sure you tick all the boxes below if they are true or do not apply before you ask for review

  • I have performed a self-review of my code
  • I have made my code as simple as possible
  • I have added relevant tests for my changes, and the code coverage has not dropped substantially
  • I have removed all commented code
  • I have updated the documentation in all relevant places (Javadoc, Swagger, MDs...)
  • I have described the PR and added a meaningful title in the Conventional Commits format

@RadovanTomik RadovanTomik self-assigned this Mar 16, 2026
Copilot AI review requested due to automatic review settings March 16, 2026 15:41
Copy link
Copy Markdown
Contributor

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

This PR adds support for an externalIdentifier for agents across the stack (DB → backend API/DTOs → frontend UI), and introduces a dedicated agent detail page to view/edit agent metadata.

Changes:

  • Backend: add externalIdentifier to Agent domain model and DTOs, update service update logic, and add Flyway migration.
  • Frontend: display externalIdentifier in the agents list and add an Agent Detail view for editing agent name/external identifier.
  • Tests: extend agent controller integration tests to cover reading/updating externalIdentifier and consolidate test setup via @IntegrationTest.

Reviewed changes

Copilot reviewed 13 out of 14 changed files in this pull request and generated 7 comments.

Show a summary per file
File Description
server/frontend/src/views/UserDetailView.vue Template formatting change for role badges.
server/frontend/src/views/QualityCheckDetailView.vue Minor template/formatting adjustments.
server/frontend/src/views/AgentsView.vue Replace list UI with a table that includes externalIdentifier.
server/frontend/src/views/AgentReportView.vue Add navigation to Agent Detail; adjust route param handling and back navigation.
server/frontend/src/views/AgentInteractionsView.vue Make agent id param handling compatible with updated routing.
server/frontend/src/views/AgentDetailView.vue New detail/edit page for agent name and externalIdentifier.
server/frontend/src/router/index.js Add /agents/:id detail route; change reports route param name.
server/frontend/src/components/Badge.vue Formatting-only change.
server/backend/src/test/java/eu/bbmri_eric/quality/server/dataquality/impl/AgentControllerTest.java Switch to @IntegrationTest and add externalIdentifier integration tests.
server/backend/src/main/resources/db/migration/V1.2__add_external_identifier_to_agent.sql Flyway migration adding external_identifier column.
server/backend/src/main/java/eu/bbmri_eric/quality/server/dataquality/impl/AgentServiceImpl.java Allow updating externalIdentifier via PATCH.
server/backend/src/main/java/eu/bbmri_eric/quality/server/dataquality/dto/AgentUpdateRequest.java Add externalIdentifier field to update request DTO.
server/backend/src/main/java/eu/bbmri_eric/quality/server/dataquality/dto/AgentDTO.java Add externalIdentifier field to agent response DTO.
server/backend/src/main/java/eu/bbmri_eric/quality/server/dataquality/domain/Agent.java Persist externalIdentifier and include it in equals/hashCode.

Comment on lines +78 to +79
if (!Objects.isNull(updateAgentDto.getExternalIdentifier())) {
agent.setExternalIdentifier(updateAgentDto.getExternalIdentifier());
const agentId = ref(route.params.id);

const agent = ref(null);
const loading = ref(false);
try {
const agentData = {
name: form.name.trim() || null,
externalIdentifier: form.externalIdentifier.trim() || null,
Comment on lines +158 to +160
const validationErrors = reactive({
name: '',
});
Comment on lines +113 to +120
<table class="table table-hover mb-0 align-middle">
<thead class="table-light">
<tr>
<th class="ps-4">ID</th>
<th>Name</th>
<th>External Identifier</th>
<th class="text-center">Status</th>
</tr>
meta: { requiresAuth: true, title: 'Agent Detail' },
},
{
path: '/agents/:agentId/reports',
@ActiveProfiles("test")
@IntegrationTest
@Transactional
class AgentControllerIntegrationTest {
@codecov
Copy link
Copy Markdown

codecov bot commented Mar 16, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 59.17%. Comparing base (b87f397) to head (54f1bd2).

Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff            @@
##             master     #368   +/-   ##
=========================================
  Coverage     59.17%   59.17%           
  Complexity      324      324           
=========================================
  Files            83       83           
  Lines          1695     1695           
  Branches        129      129           
=========================================
  Hits           1003     1003           
  Misses          643      643           
  Partials         49       49           
Flag Coverage Δ
agent 59.17% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

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.

2 participants