fix(publish): restore target version's DingTalk channels on rollback#74
Draft
totalfrank wants to merge 1 commit into
Draft
fix(publish): restore target version's DingTalk channels on rollback#74totalfrank wants to merge 1 commit into
totalfrank wants to merge 1 commit into
Conversation
execute_rollback delivered the target version's frozen config_artifact raw, without overlaying that version's stored online channel engine_overrides. Because teclaw channel config (including card_template_id) is snapshotted per-stage at publish and NOT baked into the build artifact, rollback shipped the build-time channels and left the running bot on the current (post-edit) DB channel config — so editing a card template id, publishing, then rolling back did not restore the previous card template id. Overlay the target version's stored engine_overrides_by_stage.online and re-stamp engine_ext.stage=release before redeploy, mirroring the per-stage replay _restart_bot_async already performs. No-ops for ARCA (no config_artifact) and pre-feature records (no stored overrides). Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Le8yEghGao6nhTR5jLL1n8
Contributor
|
Warning You have reached your daily quota limit. Please wait up to 24 hours and I will start processing your requests again! |
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.
Problem
Reported for teclaw bot
20260629_tl7vfiw7: editing the DingTalk cardtemplateId, publishing the bot, then rolling back does not restore the previous card templateId.Root cause
For a teclaw bot, DingTalk channel config (client_id,
card_template_id, …) is not baked into the frozen build artifact. At each promotion stage the publish flow instead:_artifact_for_stage(...), and delivers that.ext["engine_overrides_by_stage"][stage]on the publish record.The restart path (
_restart_bot_async) already re-delivers using that stored snapshot — deliberately reproducing what was promoted, not a live re-fetch.execute_rollbackdid not follow this: it passed the target version'sconfig_artifacttoupgrade_asyncraw, never overlayingengine_overrides_by_stage.online. Since the stored artifact carries only the build-time channels, rollback shipped an artifact without the target version's real online channel config, and the DB's live online row still held the newly-edited card templateId — so nothing restored the old one.Fix
In
execute_rollback, before redeploying, overlay the target version's stored onlineengine_overridesand re-stampengine_ext.stage=release, mirroring the per-stage replay_restart_bot_asyncperforms:Safe for existing paths:
config_artifact, migration_path only) →_artifact_for_stagereturnsNone, no-op.engine_overrides_by_stage) → overlay no-ops, raw artifact delivered as before.Tests
test_execute_rollback_with_config_artifactto use a realistic dict artifact and assert the restamped artifact is delivered.test_execute_rollback_overlays_stored_online_channel_overridesas the regression guard: withengine_overrides_by_stage.onlinepresent, the delivered artifact carries the stored online channels (oldcard_template_id), not the build-time draft channels.service_bot,channel, andendpointssuites pass (1097 tests).🤖 Generated with Claude Code
https://claude.ai/code/session_01Le8yEghGao6nhTR5jLL1n8
Generated by Claude Code