Fix push_config() to push labels and versions#1785
Merged
Conversation
… diff push_config() was silently dropping all label data during push because _config_to_api_body() only sent rollout weights. This adds label serialization (LabeledValue → version target, LabelRef → latest/ code_default/label target) and excludes the read-only latest_version field from the diff comparison to prevent false positives. Closes #1770
Deploying logfire-docs with
|
| Latest commit: |
9a60516
|
| Status: | ✅ Deploy successful! |
| Preview URL: | https://41c0eceb.logfire-docs.pages.dev |
| Branch Preview URL: | https://fix-push-config-labels.logfire-docs.pages.dev |
- Test all LabelRef types: latest, code_default, label-to-label ref - Test that empty labels dict omits the labels key from API body - Fixes coverage gaps in logfire/variables/remote.py
Previously docs stated that variables_push() only syncs metadata and that labels/versions must be managed through the UI. Updated to reflect that labels and versions are now included in push operations.
…s labels Cubic correctly identified that the previous doc update incorrectly attributed label/version syncing to variables_push(). Only variables_push_config() syncs labels and versions. Also fix duplicated phrasing in the getting started steps.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
_config_to_api_body()now serializesconfig.labelsinto the API body, convertingLabeledValueto version targets andLabelRefto latest/code_default/label targetspush_config()diff comparison now excludes the read-onlylatest_versionfield to prevent false-positive diffs on round-tripCloses #1770
Companion PR
labelsfield in create/update/bulk API)Test plan
Summary by cubic
Fixes
push_config()so labels and version targets are included in API requests and ignores read‑onlylatest_versionin diff checks. Docs clarifyvariables_push()is metadata‑only; usevariables_push_config()to sync labels and versions from code._config_to_api_body()now serializesconfig.labels:LabeledValue→{'target_type':'version','version','serialized_value'};LabelRef→{'target_type':'latest'|'code_default'|'label','target_label'}; omitslabelswhen empty.push_config()comparison excludeslatest_versionon both sides to prevent false‑positive diffs after round trips.Written for commit 9a60516. Summary will update on new commits.