Skip to content

chore: Standardize engine metadata - #177

Merged
khvn26 merged 2 commits into
mainfrom
copilot/standardize-engine-metadata
Oct 31, 2025
Merged

chore: Standardize engine metadata#177
khvn26 merged 2 commits into
mainfrom
copilot/standardize-engine-metadata

Conversation

CopilotAI commented Oct 31, 2025

Copy link
Copy Markdown
Contributor

Aligns Python client with other Flagsmith clients by renaming the metadata field used in client-engine communication from flagsmith_id to id. This change only affects internal metadata structures passed between client and engine—no impact on external APIs or evaluation logic.

Changes

Type definitions (flagsmith/types.py)

  • SegmentMetadata.flagsmith_idSegmentMetadata.id
  • FeatureMetadata.flagsmith_idFeatureMetadata.id

Mappers (flagsmith/mappers.py)

  • Updated all metadata dictionary keys from "flagsmith_id" to "id"
  • Renamed local variable flagsmith_id to feature_id in identity overrides mapping

Models (flagsmith/models.py)

  • Updated metadata access pattern in Flag.from_evaluation_result()

Tests

  • Updated test fixtures to use new field name

Example

# Beforeflag_result: SDKFlagResult= {
"enabled": True,
"name": "feature",
"metadata": {"flagsmith_id": 123}
}
# Afterflag_result: SDKFlagResult= {
"enabled": True,
"name": "feature",
"metadata": {"id": 123}
}

Warning

Firewall rules blocked me from connecting to one or more addresses (expand for details)

I tried to connect to the following addresses, but was blocked by firewall rules:

  • test_urlanalytics
    • Triggering command: /home/REDACTED/.cache/pypoetry/virtualenvs/flagsmith-K6knkhUn-py3.12/bin/python /home/REDACTED/.cache/pypoetry/virtualenvs/flagsmith-K6knkhUn-py3.12/bin/pytest tests/ -v --tb=short (dns block)

If you need me to access, download, or install something from one of these locations, you can either:

Original prompt

This section details on the original issue you should resolve

<issue_title>Standardize engine metadata</issue_title>
<issue_description>For context, please visit this pull request: Flagsmith/flagsmith-php-client#117

The goal of this issue is to update the metadata field name from flagsmith_id to just id, wherever it occurs.

This only affects the communication between the client and the engine, and has no influence on the evaluation product, so there is no urgency in this — only sheer motivation to make our implementation consistent across code bases, and the team aligned.</issue_description>

Comments on the Issue (you are @copilot in this section)


💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.

Co-authored-by: khvn26 <979078+khvn26@users.noreply.github.com>
@khvn26khvn26 changed the title [WIP] Update metadata field name from flagsmith_id to idchore: Standardize engine metadataOct 31, 2025
@khvn26
khvn26 marked this pull request as ready for review October 31, 2025 19:04
@khvn26
khvn26 requested a review from a team as a code ownerOctober 31, 2025 19:04
@khvn26
khvn26 requested review from gagantrivedi and removed request for a teamOctober 31, 2025 19:04

@khvn26khvn26 left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

LGTM

CopilotAI changed the title chore: Standardize engine metadataStandardize engine metadata field name from flagsmith_id to idOct 31, 2025
CopilotAI requested a review from khvn26October 31, 2025 19:06
@khvn26khvn26 changed the title Standardize engine metadata field name from flagsmith_id to idchore: Standardize engine metadataOct 31, 2025

@emylleremyller 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.

Nice job bot

@khvn26
khvn26 merged commit c0d57ec into mainOct 31, 2025
13 checks passed
@khvn26
khvn26 deleted the copilot/standardize-engine-metadata branch October 31, 2025 19:13
Sign up for freeto 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.

Standardize engine metadata

3 participants

@emyller@khvn26