Skip to content

[CRE-1299] - support white listed requests#113

Draft
gallone2000 wants to merge 2 commits into
masterfrom
alessandro_cre_1299_support_white_listed_requests
Draft

[CRE-1299] - support white listed requests#113
gallone2000 wants to merge 2 commits into
masterfrom
alessandro_cre_1299_support_white_listed_requests

Conversation

@gallone2000

Copy link
Copy Markdown

No description provided.

Copilot AI left a comment

Copy link
Copy Markdown

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 exposes per-submission strategic metadata end-to-end so that “white listed requests” (likely keyed off strategic metadata) can be represented on the Submission object and surfaced through the Python bindings.

Changes:

  • Added strategic_metadata: Option<StrategicMetadataMap> to the core Rust Submission type and initialized it in constructors.
  • Updated submission DB reads (get_submission, submission_status) to fetch strategic metadata via submissions_metadata (using json_group_object) and normalize empty metadata to None.
  • Extended the opsqueue_python Submission binding to include strategic_metadata and include it in __repr__.

Reviewed changes

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

File Description
opsqueue/src/common/submission.rs Adds strategic_metadata to Submission and populates it from DB queries via submissions_metadata aggregation.
libs/opsqueue_python/src/common.rs Surfaces strategic_metadata in the Python Submission wrapper and updates its __repr__.

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

Comment on lines 5 to 8
use crate::common::StrategicMetadataMap;
#[allow(unused_imports)]
use crate::E;
use chrono::{DateTime, Utc};
Comment on lines +281 to +285
fn normalize_strategic_metadata(
strategic_metadata: Option<sqlx::types::Json<StrategicMetadataMap>>,
) -> Option<StrategicMetadataMap> {
strategic_metadata.and_then(|json| (!json.0.is_empty()).then_some(json.0))
}
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