Skip to content

acl: add tridentVersion to the update-status annotation - #762

Merged
bfjelds (bfjelds) merged 4 commits into
mainfrom
user/bfjelds/acl-trident-version
Sep 2, 2026
Merged

acl: add tridentVersion to the update-status annotation#762
bfjelds (bfjelds) merged 4 commits into
mainfrom
user/bfjelds/acl-trident-version

Conversation

@bfjelds

@bfjelds bfjelds (bfjelds) commented Aug 31, 2026

Copy link
Copy Markdown
Member

Adds an optional tridentVersion field to the ACL A/B update-status annotation, populated from trident-acl-agent's own AGENT_VERSION on every status write.

trident-acl-agent and tridentd are built together from a single spec file (packaging/rpm/trident.spec), with one TRIDENT_VERSION stamp applied to both -p trident and -p trident-acl-agent in the same %build step, so this value doubles as the tridentd version for any RPM-installed node.

Validated: https://dev.azure.com/mariner-org/ECF/_build/results?buildId=1195298&view=logs&j=09bab65c-0c5c-54aa-a756-16c7a376f940&t=09bab65c-0c5c-54aa-a756-16c7a376f940

@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines:
Successfully started running 1 pipeline(s).
There may be pipelines that require an authorized user to comment /azp run to run.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Adds tridentVersion metadata to ACL update-status annotations.

Changes:

  • Extends UpdateStatus and its JSON schema.
  • Populates the field from AGENT_VERSION.
  • Adds serialization and constructor tests.

Reviewed changes

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

File Description
annotations/protocol.rs Adds the version field, serialization, schema, and tests.
annotations/orchestrator.rs Populates the field for invalid-request statuses.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread crates/trident-acl-agent/src/annotations/protocol.rs
Comment thread crates/trident-acl-agent/src/annotations/protocol.rs
@bfjelds
bfjelds (bfjelds) marked this pull request as ready for review September 1, 2026 18:32
@bfjelds
bfjelds (bfjelds) requested a review from a team as a code owner September 1, 2026 18:32
Copilot AI review requested due to automatic review settings September 1, 2026 18:32
@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines:
Successfully started running 1 pipeline(s).
There may be pipelines that require an authorized user to comment /azp run to run.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

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

Suppressed comments (1)

crates/trident-acl-agent/src/annotations/protocol.rs:248

  • Issue: tridentVersion is stamped when a status is constructed, not on every write as the field contract states. Evidence: publish_status can republish an UpdateStatus loaded from the completed-state cache, and refreshed_for_write() currently updates only the timestamp/message, so after an agent upgrade that write can still advertise the older writer's version. Suggestion: overwrite trident_version with the current AGENT_VERSION in refreshed_for_write() (and cover republishing a cached status with a stale or absent value).
            trident_version: Some(AGENT_VERSION.to_string()),

Copilot AI review requested due to automatic review settings September 1, 2026 18:52

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

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

Suppressed comments (1)

crates/trident-acl-agent/src/annotations/protocol.rs:291

  • Issue: Treating trident_version as stable content can create an endless PATCH/watch loop after a cached status is republished by a newer agent. Evidence: recover_from_trident_state and reconcile_node compare the unchanged persisted status with the node annotation via same_content; publish_status restamps only its cloned wire value, so the cache retains the old version and differs again on every subsequent reconcile. Suggestion: treat this write-time metadata like last_updated_utc and exclude it from deduplication (and add a stale-cache/second-reconcile regression case).
            && self.trident_version == other.trident_version

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.

Comment thread crates/trident-acl-agent/src/annotations/protocol.rs Outdated
Copilot AI review requested due to automatic review settings September 1, 2026 19:23

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 4 out of 4 changed files in this pull request and generated no new comments.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 4 out of 4 changed files in this pull request and generated no new comments.

Copilot AI review requested due to automatic review settings September 1, 2026 20:53
@bfjelds
bfjelds (bfjelds) force-pushed the user/bfjelds/acl-trident-version branch from 5b2a2b1 to 23f5892 Compare September 1, 2026 20:53

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🟢 Approval recommended

The version is consistently published, safely excluded from persisted state and deduplication, and covered by regression tests.

Review details
  • Files reviewed: 4/4 changed files
  • Comments generated: 0 new
  • Review effort level: Balanced

Copilot AI review requested due to automatic review settings September 1, 2026 22:19
@bfjelds
bfjelds (bfjelds) force-pushed the user/bfjelds/acl-trident-version branch from 23f5892 to b98f23f Compare September 1, 2026 22:19
@bfjelds
bfjelds (bfjelds) changed the base branch from main to user/bfjelds/acl-error-object September 1, 2026 22:20

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🟢 Approval recommended

The annotation, persistence, deduplication, documentation, and regression coverage are consistent and complete.

Review details
  • Files reviewed: 4/4 changed files
  • Comments generated: 0 new
  • Review effort level: Balanced

trident_error: None,
from_version: None,
to_version: None,
trident_version: Some(crate::AGENT_VERSION.to_string()),

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

nit, import AGENT_VERSION directly

trident_error: None,
from_version: None,
to_version: None,
trident_version: Some(crate::AGENT_VERSION.to_string()),

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

this will hold for now, but in the future we may want to not assume taa and tridentd are perfectly coupled

Base automatically changed from user/bfjelds/acl-error-object to main September 1, 2026 23:40
bfjelds (bfjelds) and others added 4 commits September 1, 2026 16:40
Adds an optional tridentVersion field to the ACL A/B update-status
annotation, populated from trident-acl-agent's own AGENT_VERSION on
every status write.

trident-acl-agent and tridentd are built together from a single spec
file (packaging/rpm/trident.spec), with one TRIDENT_VERSION stamp
applied to both -p trident and -p trident-acl-agent in the same
%build step, so this value doubles as the tridentd version for any
RPM-installed node.
refreshed_for_write() is the common path for every annotation write
(publish_status), but only new() stamped AGENT_VERSION. A completed
status loaded from state.json (written by a possibly older agent) and
later republished by a newer agent - e.g. recover_from_trident_state
replaying a cached commit/operation status - kept whatever
trident_version the persisted status already carried, so the
annotation no longer identified the agent that actually wrote it.

Stamp AGENT_VERSION in refreshed_for_write() instead, and add a
regression test.
…ersistence

- same_content() compared trident_version, but refreshed_for_write()
  always restamps it with the current agents AGENT_VERSION on every
  publish. Comparing it reintroduces the infinite re-publish loop
  same_content exists to prevent once the agent is upgraded.
- UpdateStatus is embedded directly in CompletedEntry (state.json) with
  deny_unknown_fields. Persisting trident_version there would break an
  older trident-acl-agent binary reading the file back after an A/B
  rollback. The persisted value is never trusted anyway, so strip it
  before writing to disk.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@bfjelds
bfjelds (bfjelds) force-pushed the user/bfjelds/acl-trident-version branch from b98f23f to 5a53d18 Compare September 1, 2026 23:40
@bfjelds
bfjelds (bfjelds) merged commit 438f880 into main Sep 2, 2026
21 checks passed
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