Skip to content
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

Add automated version replacement in example dag indexes #28090

Merged

Conversation

potiuk
Copy link
Member

@potiuk potiuk commented Dec 3, 2022

Despite earlier attempts to fix the links there were still many places
where the links were pointing to wrong versions of examples.

It has been Noticed in:
#27774 (comment)

This change addresses it in three ways:

  • updated tool to fix the linx in historically released documentation
    (applied already in Fix all example DAG links airflow-site#706)
  • replaced hard-coded version with |version| everywhere and added
    sphinx extension to convert those to actual provider versions (though
    due to sphinx limitation it has to be done with post-processing of the
    generated .html rather than replacing during generation)
  • added pre-commit that detects any use of example_dags links to
    main/master/hard-coded version.

^ Add meaningful description above

Read the Pull Request Guidelines for more information.
In case of fundamental code changes, an Airflow Improvement Proposal (AIP) is needed.
In case of a new dependency, check compliance with the ASF 3rd Party License Policy.
In case of backwards incompatible changes please leave a note in a newsfragment file, named {pr_number}.significant.rst or {issue_number}.significant.rst, in newsfragments.

@boring-cyborg boring-cyborg bot added area:providers kind:documentation provider:amazon-aws AWS/Amazon - related issues provider:google Google (including GCP) related issues labels Dec 3, 2022
@potiuk potiuk force-pushed the fix-version-generated-in-example-dags-pages branch from a894eec to a242ab9 Compare December 3, 2022 22:48
@potiuk potiuk changed the title Add automated verwion replacement in example dag indexes Add automated version replacement in example dag indexes Dec 3, 2022
@potiuk potiuk force-pushed the fix-version-generated-in-example-dags-pages branch from a242ab9 to 6b69950 Compare December 3, 2022 23:18
@potiuk potiuk force-pushed the fix-version-generated-in-example-dags-pages branch 3 times, most recently from 5c1ad30 to 1971363 Compare December 4, 2022 01:13
@potiuk potiuk requested a review from ashb as a code owner December 4, 2022 01:13
@potiuk
Copy link
Member Author

potiuk commented Dec 4, 2022

Also including fix to the tool correcting example_dag links

@potiuk
Copy link
Member Author

potiuk commented Dec 4, 2022

cc: @Taragolis

@potiuk potiuk requested a review from Taragolis December 4, 2022 01:15
@potiuk potiuk force-pushed the fix-version-generated-in-example-dags-pages branch from 1971363 to 583d3e8 Compare December 4, 2022 02:02
@potiuk
Copy link
Member Author

potiuk commented Dec 4, 2022

@Taragolis - I already corrected all the historical links in apache/airflow-site#706 - so the current documentation published should already have (I hope all) example_dags links properly linked to the right example versions.

This one should fix generating the documentation in the first place.

@potiuk
Copy link
Member Author

potiuk commented Dec 4, 2022

Looks like it handles all cases (including references to the example DAGs from random pages like in yandex case (see the links at the bottom of the screen):

Screenshot 2022-12-04 at 13 11 49

Screenshot 2022-12-04 at 13 11 57

Screenshot 2022-12-04 at 13 18 03

Screenshot 2022-12-04 at 13 11 16

Despite earlier attempts to fix the links there were still many places
where the links were pointing to wrong versions of examples.

It has been Noticed in:
apache#27774 (comment)

This change addresses it in three ways:

* updated tool to fix the linx in historically released documentation
  (applied already in apache/airflow-site#706)
* replaced hard-coded version with `|version|` everywhere and added
  sphinx extension to convert those to actual provider versions (though
  due to sphinx limitation it has to be done with post-processing of the
  generated .html rather than replacing during generation)
* added pre-commit that detects any use of example_dags links to
  main/master/hard-coded version.
@potiuk potiuk force-pushed the fix-version-generated-in-example-dags-pages branch from 583d3e8 to f2e2416 Compare December 4, 2022 15:43
@potiuk
Copy link
Member Author

potiuk commented Dec 4, 2022

I added pre-commit preventing hard-coded example dags to be part of the documentation and found few more places which i missed thanks to that :).

I also added better description for the commit - describing the context of the change and decribing that the fix really addresses 3 problems:

  • historically generated links (past)
  • automated conversion of the existing links (present)
  • preventing further accidental document commits with hard-coded links via pre-commit (future)

@potiuk
Copy link
Member Author

potiuk commented Dec 5, 2022

cc: @Taragolis :)

@potiuk potiuk merged commit c8e348d into apache:main Dec 5, 2022
@potiuk potiuk deleted the fix-version-generated-in-example-dags-pages branch December 5, 2022 19:06
potiuk added a commit to potiuk/airflow that referenced this pull request Dec 6, 2022
jedcunningham pushed a commit that referenced this pull request Dec 6, 2022
@pierrejeambrun pierrejeambrun added this to the Airflow 2.5.1 milestone Jan 9, 2023
@pierrejeambrun pierrejeambrun added the type:misc/internal Changelog: Misc changes that should appear in change log label Jan 9, 2023
pierrejeambrun pushed a commit that referenced this pull request Jan 12, 2023
Despite earlier attempts to fix the links there were still many places
where the links were pointing to wrong versions of examples.

It has been Noticed in:
#27774 (comment)

This change addresses it in three ways:

* updated tool to fix the linx in historically released documentation
  (applied already in apache/airflow-site#706)
* replaced hard-coded version with `|version|` everywhere and added
  sphinx extension to convert those to actual provider versions (though
  due to sphinx limitation it has to be done with post-processing of the
  generated .html rather than replacing during generation)
* added pre-commit that detects any use of example_dags links to
  main/master/hard-coded version.

(cherry picked from commit c8e348d)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area:providers kind:documentation provider:amazon-aws AWS/Amazon - related issues provider:google Google (including GCP) related issues type:misc/internal Changelog: Misc changes that should appear in change log
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants