Skip to content

Rust guard: honor GraphQL authorAssociation in project items - #9697

Merged
lpcox merged 2 commits into
mainfrom
copilot/rust-guard-use-get-author-association
Jul 20, 2026
Merged

Rust guard: honor GraphQL authorAssociation in project items#9697
lpcox merged 2 commits into
mainfrom
copilot/rust-guard-use-get-author-association

Conversation

Copilot AI commented Jul 20, 2026

Copy link
Copy Markdown
Contributor

Project-item integrity labeling in the Rust guard handled REST-style author_association but missed GraphQL authorAssociation, causing GraphQL-backed list_project_items / projects_list items to lose association-derived integrity labels. This change aligns project-item labeling with the existing cross-API helper and finishes the remaining login field-name centralization.

  • Project item integrity labeling

    • Replace the direct get_str_or(..., "author_association", "") lookup in response_paths.rs with get_author_association(...).
    • Preserve existing behavior for missing associations while correctly handling both REST snake_case and GraphQL camelCase payloads.
  • Field-name centralization

    • Replace the two remaining raw "login" lookups with field_names::LOGIN in:
      • labels/helpers.rs
      • labels/backend.rs
  • Coverage for GraphQL payloads

    • Add a focused Rust test proving a project item with content.authorAssociation receives the expected association-derived integrity label.

Example of the core change:

let association = get_author_association(content);
let integrity = author_association_floor_from_str(
    integrity_scope,
    association,
    ctx,
);

Copilot AI changed the title [WIP] Update Rust Guard to use get_author_association consistently Rust guard: honor GraphQL authorAssociation in project items Jul 20, 2026
Copilot finished work on behalf of lpcox July 20, 2026 13:51
Copilot AI requested a review from lpcox July 20, 2026 13:51
@lpcox
lpcox marked this pull request as ready for review July 20, 2026 15:00
Copilot AI review requested due to automatic review settings July 20, 2026 15:00

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

Fixes #9687 by correctly deriving project-item integrity from both REST and GraphQL author-association fields.

Changes:

  • Uses the cross-API get_author_association helper.
  • Centralizes remaining "login" field lookups.
  • Adds focused GraphQL project-item coverage.
Show a summary per file
File Description
response_paths.rs Handles camelCase GraphQL associations and adds a regression test.
helpers.rs Uses the centralized login constant.
backend.rs Uses the centralized login constant.

Review details

Tip

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

  • Files reviewed: 3/3 changed files
  • Comments generated: 0
  • Review effort level: Medium

@lpcox
lpcox merged commit 643beac into main Jul 20, 2026
41 of 42 checks passed
@lpcox
lpcox deleted the copilot/rust-guard-use-get-author-association branch July 20, 2026 15:02
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.

[rust-guard] Rust Guard: Use get_author_association helper and field_names::LOGIN constant consistently

3 participants