Skip to content

Conversation

Copy link
Contributor

Copilot AI commented Oct 31, 2025

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

# Before
flag_result: SDKFlagResult = {
    "enabled": True,
    "name": "feature",
    "metadata": {"flagsmith_id": 123}
}

# After
flag_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.

@khvn26 khvn26 changed the title [WIP] Update metadata field name from flagsmith_id to id chore: Standardize engine metadata Oct 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 owner October 31, 2025 19:04
@khvn26 khvn26 requested review from gagantrivedi and removed request for a team October 31, 2025 19:04
Copy link
Member

@khvn26 khvn26 left a comment

Choose a reason for hiding this comment

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

LGTM

Copilot AI changed the title chore: Standardize engine metadata Standardize engine metadata field name from flagsmith_id to id Oct 31, 2025
Copilot finished work on behalf of khvn26 October 31, 2025 19:06
Copilot AI requested a review from khvn26 October 31, 2025 19:06
@khvn26 khvn26 changed the title Standardize engine metadata field name from flagsmith_id to id chore: Standardize engine metadata Oct 31, 2025
Copy link
Contributor

@emyller emyller left a comment

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 main Oct 31, 2025
13 checks passed
@khvn26 khvn26 deleted the copilot/standardize-engine-metadata branch October 31, 2025 19:13
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.

Standardize engine metadata

3 participants