-
Notifications
You must be signed in to change notification settings - Fork 16.4k
Refactor bundle view_url to not instaniate bundle on server components #52876
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
ephraimbuddy
merged 33 commits into
apache:main
from
astronomer:template-bundle-view-url
Jul 31, 2025
Merged
Changes from all commits
Commits
Show all changes
33 commits
Select commit
Hold shift + click to select a range
34120fe
Refactor bundle view_url to not instaniate bundle on server components
ephraimbuddy c622adb
fixup! Refactor bundle view_url to not instaniate bundle on server co…
ephraimbuddy c927764
Rename bundle url to url_template and fix backcompat
ephraimbuddy bfd723a
Refactor render_url to not depend on dagbundlemodel version
ephraimbuddy c22d3d1
Render view_url_template in view_url
ephraimbuddy ad13791
fixup! Render view_url_template in view_url
ephraimbuddy b07a898
Add deprecation warning and update s3 bundle with view_url_template
ephraimbuddy 21f5b77
fixup! Add deprecation warning and update s3 bundle with view_url_tem…
ephraimbuddy d037114
Remove deprecation warning in provider's view_url
ephraimbuddy d1495ac
fixup! Remove deprecation warning in provider's view_url
ephraimbuddy 1395fe3
fixup! fixup! Remove deprecation warning in provider's view_url
ephraimbuddy 5922d8f
Add backcompat for bundles vs airflow releases
ephraimbuddy 83a481c
fixup! Add backcompat for bundles vs airflow releases
ephraimbuddy 0cbddc7
rename url_template to signed_url_template. Also return None when we …
ephraimbuddy 07bf1ab
refactor template signing
ephraimbuddy 8158632
fixup! refactor template signing
ephraimbuddy cfc3c27
Fix templating and conflict
ephraimbuddy dec98c4
Fix backcompat & refactor template signing
ephraimbuddy 7d48388
fixup! Fix backcompat & refactor template signing
ephraimbuddy 8c63671
fixup! fixup! Fix backcompat & refactor template signing
ephraimbuddy dcbffbb
skip some test if not airflow 3.1+
ephraimbuddy abff6cc
fixup! skip some test if not airflow 3.1+
ephraimbuddy 9ee12d1
fixup! fixup! skip some test if not airflow 3.1+
ephraimbuddy af03c99
Resolve conflict
ephraimbuddy f982f7f
Add version to be removed for deprecated view_url
ephraimbuddy 258ecad
Remove template_fields and use regex to extract placeholders
ephraimbuddy 23cdf57
Fix conflict
ephraimbuddy 46f730e
fixup! Remove template_fields and use regex to extract placeholders
ephraimbuddy 002dd5f
Remove added deadline in dag details
ephraimbuddy 8f460fb
Update docs
ephraimbuddy 8fb7b0c
Remove ; from url safety check
ephraimbuddy b0e8a1c
Log url sanity check errors
ephraimbuddy 5bf2505
compile re
ephraimbuddy File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1 +1 @@ | ||
| d2e81695973bf8b6b30e1f4543627547330ef531e50be633cf589fbdf639b0e8 | ||
| efbae2f1de68413e5a6f671a306e748581fe454b81e25eeb2927567f11ebd59c |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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
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
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
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
53 changes: 53 additions & 0 deletions
53
.../airflow/migrations/versions/0080_3_1_0_add_url_and_template_params_to_dagbundle_model.py
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,53 @@ | ||
| # | ||
| # Licensed to the Apache Software Foundation (ASF) under one | ||
| # or more contributor license agreements. See the NOTICE file | ||
| # distributed with this work for additional information | ||
| # regarding copyright ownership. The ASF licenses this file | ||
| # to you under the Apache License, Version 2.0 (the | ||
| # "License"); you may not use this file except in compliance | ||
| # with the License. You may obtain a copy of the License at | ||
| # | ||
| # http://www.apache.org/licenses/LICENSE-2.0 | ||
| # | ||
| # Unless required by applicable law or agreed to in writing, | ||
| # software distributed under the License is distributed on an | ||
| # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY | ||
| # KIND, either express or implied. See the License for the | ||
| # specific language governing permissions and limitations | ||
| # under the License. | ||
|
|
||
| """ | ||
| Add url template and template params to DagBundleModel. | ||
|
|
||
| Revision ID: 3bda03debd04 | ||
| Revises: f56f68b9e02f | ||
| Create Date: 2025-07-04 10:12:12.711292 | ||
|
|
||
| """ | ||
|
|
||
| from __future__ import annotations | ||
|
|
||
| import sqlalchemy as sa | ||
| from alembic import op | ||
| from sqlalchemy_utils import JSONType | ||
|
|
||
| # revision identifiers, used by Alembic. | ||
| revision = "3bda03debd04" | ||
| down_revision = "f56f68b9e02f" | ||
| branch_labels = None | ||
| depends_on = None | ||
| airflow_version = "3.1.0" | ||
|
|
||
|
|
||
| def upgrade(): | ||
| """Apply Add url and template params to DagBundleModel.""" | ||
| with op.batch_alter_table("dag_bundle", schema=None) as batch_op: | ||
| batch_op.add_column(sa.Column("signed_url_template", sa.String(length=200), nullable=True)) | ||
| batch_op.add_column(sa.Column("template_params", JSONType(), nullable=True)) | ||
|
|
||
|
|
||
| def downgrade(): | ||
| """Unapply Add url and template params to DagBundleModel.""" | ||
| with op.batch_alter_table("dag_bundle", schema=None) as batch_op: | ||
| batch_op.drop_column("template_params") | ||
| batch_op.drop_column("signed_url_template") |
Oops, something went wrong.
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.
Uh oh!
There was an error while loading. Please reload this page.