Assert the refusal log with getMessage so the compat tests pass - #70905
Merged
potiuk merged 1 commit intoAug 1, 2026
Conversation
The refusal-logging assertions in the Amazon secrets tests read record.msg directly. How a record carries its payload depends on the Airflow version: on main, structlog renders the format args into msg before the stdlib record exists, so args is empty and msg holds the final text; on the versions the provider compat tests run against, plain stdlib logging leaves msg as the format string with the values in args. Reading msg therefore passes on main and fails under Compat 2.11.1 and 3.0.6, which is where these currently break: assert 0 == 1 where 0 = sum(refused_id in r.msg for r in refusals) getMessage() renders in both shapes. The assertion still targets the refused id rather than the wording, so rephrasing the warning stays free. Introduced in apache#70878, where the assertions were moved off getMessage and verified only against main.
5 tasks
Contributor
Backport failed to create: v3-3-test. View the failure log Run detailsNote: As of Merging PRs targeted for Airflow 3.X In matter of doubt please ask in #release-management Slack channel.
You can attempt to backport this manually by running: cherry_picker 8146228 v3-3-testThis should apply the commit to the v3-3-test branch and leave the commit in conflict state marking After you have resolved the conflicts, you can continue the backport process by running: cherry_picker --continueIf you don't have cherry-picker installed, see the installation guide. |
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.
mainis currently red on the provider compat jobs. The refusal-loggingassertions in the Amazon secrets tests read
record.msgdirectly, and how arecord carries its payload depends on the Airflow version:
So the assertions pass on
mainand fail underCompat 2.11.1:P3.10andCompat 3.0.6:P3.10:getMessage()renders in both shapes. The assertion still targets the refusedid rather than the wording, which was the point of moving off the rendered
sentence in the first place — that intent is unchanged, only the accessor.
This is a regression from #70878, where I moved these assertions off
getMessage()while addressing review feedback and verified only againstmain.Compat runs on provider PRs, so it surfaced on the next provider PR rather than
on the one that introduced it.
Kept separate from #70899 (the Azure
get_configfollow-up) so the repair tomaincan land on its own.Test plan
providers/amazon/tests/unit/amazon/aws/secrets/— 73 passed locallyr.msgmatches only the pre-renderedone,
getMessage()matches bothruff formatcleanWas generative AI tooling used to co-author this PR?
Generated-by: Claude Opus 5 (1M context) following the guidelines at
https://github.com/apache/airflow/blob/main/contributing-docs/05_pull_requests.rst#gen-ai-assisted-contributions