Skip to content

Conversation

@ephraimbuddy
Copy link
Contributor

This refactor introduces a view_url_template in bundle configuration which is saved in the db and rendered when needed. The url is signed with [api]secret_key for security. Also the view_url_template is also checked for safety before saving to the DB

@ephraimbuddy ephraimbuddy force-pushed the template-bundle-view-url branch 2 times, most recently from 8da6ab7 to f7c87a8 Compare July 6, 2025 21:01
@ephraimbuddy ephraimbuddy force-pushed the template-bundle-view-url branch 2 times, most recently from 1bd04af to c6561d1 Compare July 7, 2025 11:42
@ephraimbuddy ephraimbuddy requested a review from ashb July 7, 2025 12:48
@ephraimbuddy
Copy link
Contributor Author

One thing to note while reviewing is that only 'http' and 'https' protocol are accepted for view_url_template. Let me know if this should be expanded

@ephraimbuddy ephraimbuddy force-pushed the template-bundle-view-url branch from 5a5e7b5 to 157ada0 Compare July 7, 2025 13:40
Copy link
Member

@pierrejeambrun pierrejeambrun left a comment

Choose a reason for hiding this comment

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

LGTM, but we probably want another pair of eyes as this PR is quite big. (easy to miss something)

@ephraimbuddy ephraimbuddy force-pushed the template-bundle-view-url branch from a1e103d to 5bf2505 Compare July 30, 2025 19:34
@ephraimbuddy ephraimbuddy merged commit 48d6534 into apache:main Jul 31, 2025
103 checks passed
@ephraimbuddy ephraimbuddy deleted the template-bundle-view-url branch July 31, 2025 07:33
RoyLee1224 pushed a commit to RoyLee1224/airflow that referenced this pull request Jul 31, 2025
apache#52876)

* Refactor bundle view_url to not instaniate bundle on server components

This refactor introduces a view_url_template in bundle configuration
which is saved in the db and rendered when needed. The url is signed
with [api]secret_key for security. Also the view_url_template is
also checked for safety before saving to the DB

* fixup! Refactor bundle view_url to not instaniate bundle on server components

* Rename bundle url to url_template and fix backcompat

* Refactor render_url to not depend on dagbundlemodel version

* Render view_url_template in view_url

* fixup! Render view_url_template in view_url

* Add deprecation warning and update s3 bundle with view_url_template

* fixup! Add deprecation warning and update s3 bundle with view_url_template

* Remove deprecation warning in provider's view_url

* fixup! Remove deprecation warning in provider's view_url

* fixup! fixup! Remove deprecation warning in provider's view_url

* Add backcompat for bundles vs airflow releases

* fixup! Add backcompat for bundles vs airflow releases

* rename url_template to signed_url_template. Also return None when we can't unsign a url

* refactor template signing

* fixup! refactor template signing

* Fix templating and conflict

* Fix backcompat & refactor template signing

* fixup! Fix backcompat & refactor template signing

* fixup! fixup! Fix backcompat & refactor template signing

* skip some test if not airflow 3.1+

* fixup! skip some test if not airflow 3.1+

* fixup! fixup! skip some test if not airflow 3.1+

* Resolve conflict

* Add version to be removed for deprecated view_url

* Remove template_fields and use regex to extract placeholders

* Fix conflict

* fixup! Remove template_fields and use regex to extract placeholders

* Remove added deadline in dag details

* Update docs

* Remove ; from url safety check

* Log url sanity check errors

* compile re
ferruzzi pushed a commit to aws-mwaa/upstream-to-airflow that referenced this pull request Aug 7, 2025
apache#52876)

* Refactor bundle view_url to not instaniate bundle on server components

This refactor introduces a view_url_template in bundle configuration
which is saved in the db and rendered when needed. The url is signed
with [api]secret_key for security. Also the view_url_template is
also checked for safety before saving to the DB

* fixup! Refactor bundle view_url to not instaniate bundle on server components

* Rename bundle url to url_template and fix backcompat

* Refactor render_url to not depend on dagbundlemodel version

* Render view_url_template in view_url

* fixup! Render view_url_template in view_url

* Add deprecation warning and update s3 bundle with view_url_template

* fixup! Add deprecation warning and update s3 bundle with view_url_template

* Remove deprecation warning in provider's view_url

* fixup! Remove deprecation warning in provider's view_url

* fixup! fixup! Remove deprecation warning in provider's view_url

* Add backcompat for bundles vs airflow releases

* fixup! Add backcompat for bundles vs airflow releases

* rename url_template to signed_url_template. Also return None when we can't unsign a url

* refactor template signing

* fixup! refactor template signing

* Fix templating and conflict

* Fix backcompat & refactor template signing

* fixup! Fix backcompat & refactor template signing

* fixup! fixup! Fix backcompat & refactor template signing

* skip some test if not airflow 3.1+

* fixup! skip some test if not airflow 3.1+

* fixup! fixup! skip some test if not airflow 3.1+

* Resolve conflict

* Add version to be removed for deprecated view_url

* Remove template_fields and use regex to extract placeholders

* Fix conflict

* fixup! Remove template_fields and use regex to extract placeholders

* Remove added deadline in dag details

* Update docs

* Remove ; from url safety check

* Log url sanity check errors

* compile re
fweilun pushed a commit to fweilun/airflow that referenced this pull request Aug 11, 2025
apache#52876)

* Refactor bundle view_url to not instaniate bundle on server components

This refactor introduces a view_url_template in bundle configuration
which is saved in the db and rendered when needed. The url is signed
with [api]secret_key for security. Also the view_url_template is
also checked for safety before saving to the DB

* fixup! Refactor bundle view_url to not instaniate bundle on server components

* Rename bundle url to url_template and fix backcompat

* Refactor render_url to not depend on dagbundlemodel version

* Render view_url_template in view_url

* fixup! Render view_url_template in view_url

* Add deprecation warning and update s3 bundle with view_url_template

* fixup! Add deprecation warning and update s3 bundle with view_url_template

* Remove deprecation warning in provider's view_url

* fixup! Remove deprecation warning in provider's view_url

* fixup! fixup! Remove deprecation warning in provider's view_url

* Add backcompat for bundles vs airflow releases

* fixup! Add backcompat for bundles vs airflow releases

* rename url_template to signed_url_template. Also return None when we can't unsign a url

* refactor template signing

* fixup! refactor template signing

* Fix templating and conflict

* Fix backcompat & refactor template signing

* fixup! Fix backcompat & refactor template signing

* fixup! fixup! Fix backcompat & refactor template signing

* skip some test if not airflow 3.1+

* fixup! skip some test if not airflow 3.1+

* fixup! fixup! skip some test if not airflow 3.1+

* Resolve conflict

* Add version to be removed for deprecated view_url

* Remove template_fields and use regex to extract placeholders

* Fix conflict

* fixup! Remove template_fields and use regex to extract placeholders

* Remove added deadline in dag details

* Update docs

* Remove ; from url safety check

* Log url sanity check errors

* compile re
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants