You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airflow.apache.org by "potiuk (via GitHub)" <gi...@apache.org> on 2023/06/09 11:34:30 UTC

[GitHub] [airflow-site] potiuk commented on a diff in pull request #794: Building framework to allow multiple types of back referencing docs

potiuk commented on code in PR #794:
URL: https://github.com/apache/airflow-site/pull/794#discussion_r1224190939


##########
post-docs/add-back-references.py:
##########
@@ -14,16 +14,34 @@
 # KIND, either express or implied.  See the License for the
 # specific language governing permissions and limitations
 # under the License.
-
+import enum
+import logging
 import os
+import sys
 from urllib.request import urlopen
 import semver
 
-docs_link = "https://raw.githubusercontent.com/apache/airflow/main/docs/apache-airflow/redirects.txt"
+airflow_redirects_link = "https://raw.githubusercontent.com/apache/airflow/main/docs/apache-airflow/redirects.txt"
+helm_redirects_link = "https://raw.githubusercontent.com/apache/airflow/main/docs/helm-chart/redirects.txt"
+providers_redirect_link = "populate-this"
+
 docs_archive_path = "../docs-archive"
-apache_airflow_path = docs_archive_path + "/apache-airflow"
-stable_version_path = apache_airflow_path + "/stable.txt"
-new_docs_version = "2.5.1"
+airflow_docs_path = docs_archive_path + "/apache-airflow"
+helm_docs_path = docs_archive_path + "/helm-chart"
+providers_docs_path = docs_archive_path + "/apache-airflow-providers"
+
+# version where changes were introduced in docs structure
+new_airflow_docs_version = "2.5.1"

Review Comment:
   Question: Can we do it regardless for latest versions ?  I believe (correct me if I am wrong please) that when you get the "latest" version, and there are no redirects we could check if the file that we want to create redirect from exists already and skip if it does - this way we will not override "target" files, but we will be able to re-run it at any time from latest version, making it effectively idempotent.
   
   Smth like: 
   
   ```
   
   def create_back_reference_html(back_ref_url, path):
       content = get_redirect_content(back_ref_url)
      if Path(path).exists(): # <-- check if the target file exists already
         return 
       # Creating an HTML file
       with open(path, "w") as f:
           f.write(content)
   ```
   



-- 
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