You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airflow.apache.org by GitBox <gi...@apache.org> on 2021/08/06 20:55:09 UTC
[GitHub] [airflow] bradarndt opened a new pull request #17477: Open relative extra links in place
bradarndt opened a new pull request #17477:
URL: https://github.com/apache/airflow/pull/17477
This PR changes the existing behavior ["extra links" added to operators](https://github.com/apache/airflow/blob/main/docs/apache-airflow/howto/define_extra_link.rst) such that any _relative_ links open in place rather than in a new window/tab. This is consistent with the way other links/buttons in Airflow work today. Any absolute links will continue to open in a new window/tab as they do today.
For the purposes of this change, a "relative" link is defined as any link url that does not satisfy the following regular expression: `^(?:[a-z]+:)?//`. See [this stack overflow post](https://stackoverflow.com/a/19709846) for more in depth discussion.
_Note: As a first time contributor, I've followed the contributing documentation as much as possible. I could not find any existing tests to update for the www js code, so given the simplicity of this change, I did not add any tests, however, I did run all WWW tests as well as static analysis. Please let me know if i missed something or this is otherwise unacceptable. Looking forward to feedback!_
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@airflow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [airflow] jedcunningham commented on pull request #17477: Open relative extra links in place
Posted by GitBox <gi...@apache.org>.
jedcunningham commented on pull request #17477:
URL: https://github.com/apache/airflow/pull/17477#issuecomment-899606110
Congrats @bradarndt on your first commit! Thanks for contributing πΊ
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@airflow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [airflow] jedcunningham closed pull request #17477: Open relative extra links in place
Posted by GitBox <gi...@apache.org>.
jedcunningham closed pull request #17477:
URL: https://github.com/apache/airflow/pull/17477
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@airflow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [airflow] bradarndt commented on pull request #17477: Open relative extra links in place
Posted by GitBox <gi...@apache.org>.
bradarndt commented on pull request #17477:
URL: https://github.com/apache/airflow/pull/17477#issuecomment-898732056
> Sorry, I should have looked more closely. Since main isn't currently failing, can you try rebasing on main? You probably waited long enough π
Done. Will keep an eye on the build.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@airflow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [airflow] jedcunningham closed pull request #17477: Open relative extra links in place
Posted by GitBox <gi...@apache.org>.
jedcunningham closed pull request #17477:
URL: https://github.com/apache/airflow/pull/17477
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@airflow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [airflow] jedcunningham commented on pull request #17477: Open relative extra links in place
Posted by GitBox <gi...@apache.org>.
jedcunningham commented on pull request #17477:
URL: https://github.com/apache/airflow/pull/17477#issuecomment-898701320
(closed/reopened to rekick CI)
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@airflow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [airflow] jedcunningham commented on pull request #17477: Open relative extra links in place
Posted by GitBox <gi...@apache.org>.
jedcunningham commented on pull request #17477:
URL: https://github.com/apache/airflow/pull/17477#issuecomment-898722128
Sorry, I should have looked more closely. Since main isn't currently failing, can you try rebasing on main? You probably waited long enough π
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@airflow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [airflow] jedcunningham commented on a change in pull request #17477: Open relative extra links in place
Posted by GitBox <gi...@apache.org>.
jedcunningham commented on a change in pull request #17477:
URL: https://github.com/apache/airflow/pull/17477#discussion_r684539429
##########
File path: airflow/www/static/js/dag.js
##########
@@ -190,6 +190,8 @@ export function callModal(t, d, extraLinks, tryNumbers, sd) {
cache: false,
success(data) {
externalLink.attr('href', data.url);
+ if(/^(?:[a-z]+:)?\/\//.test(data.url))
+ externalLink.attr('target', '_blank');
Review comment:
```suggestion
if (/^(?:[a-z]+:)?\/\//.test(data.url)) {
externalLink.attr('target', '_blank');
}
```
(Just to keep it consistent stylistically)
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@airflow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [airflow] bradarndt commented on pull request #17477: Open relative extra links in place
Posted by GitBox <gi...@apache.org>.
bradarndt commented on pull request #17477:
URL: https://github.com/apache/airflow/pull/17477#issuecomment-899564866
> @bradarndt, looks like 2 static check failures, both should be easy to fix. I'd also suggest that you [set up the pre-commit hooks](https://github.com/apache/airflow/blob/main/STATIC_CODE_CHECKS.rst#prerequisites-for-pre-commit-hooks), they help catch these issues early π.
Thanks for the suggestion @jedcunningham. Fixed the formatting (as well as enabled pre-commit hooks).
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@airflow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [airflow] jedcunningham commented on pull request #17477: Open relative extra links in place
Posted by GitBox <gi...@apache.org>.
jedcunningham commented on pull request #17477:
URL: https://github.com/apache/airflow/pull/17477#issuecomment-898764077
@bradarndt, looks like 2 static check failures, both should be easy to fix. I'd also suggest that you [set up the pre-commit hooks](https://github.com/apache/airflow/blob/main/STATIC_CODE_CHECKS.rst#prerequisites-for-pre-commit-hooks), they help catch these issues early π.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@airflow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [airflow] boring-cyborg[bot] commented on pull request #17477: Open relative extra links in place
Posted by GitBox <gi...@apache.org>.
boring-cyborg[bot] commented on pull request #17477:
URL: https://github.com/apache/airflow/pull/17477#issuecomment-899605189
Awesome work, congrats on your first merged pull request!
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@airflow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [airflow] github-actions[bot] commented on pull request #17477: Open relative extra links in place
Posted by GitBox <gi...@apache.org>.
github-actions[bot] commented on pull request #17477:
URL: https://github.com/apache/airflow/pull/17477#issuecomment-895270682
The PR is likely OK to be merged with just subset of tests for default Python and Database versions without running the full matrix of tests, because it does not modify the core of Airflow. If the committers decide that the full tests matrix is needed, they will add the label 'full tests needed'. Then you should rebase to the latest main or amend the last commit of the PR, and push it with --force-with-lease.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@airflow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [airflow] bradarndt commented on pull request #17477: Open relative extra links in place
Posted by GitBox <gi...@apache.org>.
bradarndt commented on pull request #17477:
URL: https://github.com/apache/airflow/pull/17477#issuecomment-898717526
@jedcunningham (i noticed that you re-triggered the CI build). The build is failing due to a failed build constraint:
```
ERROR: Cannot install apache-airflow[devel-ci]==2.2.0.dev0 because these package versions have conflicting dependencies.
The conflict is caused by:
apache-airflow[devel-ci] 2.2.0.dev0 depends on google-ads<8.0.0 and >=4.0.0
The user requested (constraint) google-ads==12.0.0
```
I believe this is unrelated to my change, as a clean build failed even before I made any changes and I didn't change any dependencies. However, I haven't had the chance to track down the root of the issue yet. I was hoping that if I gave it a while, a fix to the root cause might be merged in allowing my change to then build successfully.
Does that sound like a reasonable approach? Or should I try to hunt down the cause?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@airflow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [airflow] jedcunningham merged pull request #17477: Open relative extra links in place
Posted by GitBox <gi...@apache.org>.
jedcunningham merged pull request #17477:
URL: https://github.com/apache/airflow/pull/17477
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@airflow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [airflow] bbovenzi commented on a change in pull request #17477: Open relative extra links in place
Posted by GitBox <gi...@apache.org>.
bbovenzi commented on a change in pull request #17477:
URL: https://github.com/apache/airflow/pull/17477#discussion_r685094417
##########
File path: airflow/www/static/js/dag.js
##########
@@ -190,6 +190,8 @@ export function callModal(t, d, extraLinks, tryNumbers, sd) {
cache: false,
success(data) {
externalLink.attr('href', data.url);
+ if(/^(?:[a-z]+:)?\/\//.test(data.url))
Review comment:
Let's put a comment above this line to explain that the regex detects local vs external routes.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@airflow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [airflow] boring-cyborg[bot] commented on pull request #17477: Open relative extra links in place
Posted by GitBox <gi...@apache.org>.
boring-cyborg[bot] commented on pull request #17477:
URL: https://github.com/apache/airflow/pull/17477#issuecomment-894513459
Congratulations on your first Pull Request and welcome to the Apache Airflow community! If you have any issues or are unsure about any anything please check our Contribution Guide (https://github.com/apache/airflow/blob/main/CONTRIBUTING.rst)
Here are some useful points:
- Pay attention to the quality of your code (flake8, mypy and type annotations). Our [pre-commits]( https://github.com/apache/airflow/blob/main/STATIC_CODE_CHECKS.rst#prerequisites-for-pre-commit-hooks) will help you with that.
- In case of a new feature add useful documentation (in docstrings or in `docs/` directory). Adding a new operator? Check this short [guide](https://github.com/apache/airflow/blob/main/docs/apache-airflow/howto/custom-operator.rst) Consider adding an example DAG that shows how users should use it.
- Consider using [Breeze environment](https://github.com/apache/airflow/blob/main/BREEZE.rst) for testing locally, itβs a heavy docker but it ships with a working Airflow and a lot of integrations.
- Be patient and persistent. It might take some time to get a review or get the final approval from Committers.
- Please follow [ASF Code of Conduct](https://www.apache.org/foundation/policies/conduct) for all communication including (but not limited to) comments on Pull Requests, Mailing list and Slack.
- Be sure to read the [Airflow Coding style]( https://github.com/apache/airflow/blob/main/CONTRIBUTING.rst#coding-style-and-best-practices).
Apache Airflow is a community-driven project and together we are making it better π.
In case of doubts contact the developers at:
Mailing List: dev@airflow.apache.org
Slack: https://s.apache.org/airflow-slack
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@airflow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [airflow] bradarndt commented on a change in pull request #17477: Open relative extra links in place
Posted by GitBox <gi...@apache.org>.
bradarndt commented on a change in pull request #17477:
URL: https://github.com/apache/airflow/pull/17477#discussion_r685170802
##########
File path: airflow/www/static/js/dag.js
##########
@@ -190,6 +190,8 @@ export function callModal(t, d, extraLinks, tryNumbers, sd) {
cache: false,
success(data) {
externalLink.attr('href', data.url);
+ if(/^(?:[a-z]+:)?\/\//.test(data.url))
+ externalLink.attr('target', '_blank');
Review comment:
Thanks for the review! Change made in commit https://github.com/apache/airflow/pull/17477/commits/267eec89a1a0c764c85d302e5d9a2af424c6b3f6
##########
File path: airflow/www/static/js/dag.js
##########
@@ -190,6 +190,8 @@ export function callModal(t, d, extraLinks, tryNumbers, sd) {
cache: false,
success(data) {
externalLink.attr('href', data.url);
+ if(/^(?:[a-z]+:)?\/\//.test(data.url))
Review comment:
Thanks for the review! Change made in commit https://github.com/apache/airflow/pull/17477/commits/267eec89a1a0c764c85d302e5d9a2af424c6b3f6
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@airflow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [airflow] bradarndt commented on pull request #17477: Open relative extra links in place
Posted by GitBox <gi...@apache.org>.
bradarndt commented on pull request #17477:
URL: https://github.com/apache/airflow/pull/17477#issuecomment-899621496
> Congrats @bradarndt on your first commit! Thanks for contributing πΊ
Thanks! I appreciate the guiding hand along the way!
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@airflow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org