You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airflow.apache.org by "bugraoz93 (via GitHub)" <gi...@apache.org> on 2025/04/09 23:26:28 UTC

[PR] [WIP] AIP-81 feat (airflowctl): Initial airflowctl docs [airflow]

bugraoz93 opened a new pull request, #49024:
URL: https://github.com/apache/airflow/pull/49024

   closes: #47537
   <!--
    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.
    -->
   
   <!--
   Thank you for contributing! Please make sure that your code changes
   are covered with tests. And in case of new features or big changes
   remember to adjust the documentation.
   
   Feel free to ping committers for the review!
   
   In case of an existing issue, reference it using one of the following:
   
   closes: #ISSUE
   related: #ISSUE
   
   How to write a good git commit message:
   http://chris.beams.io/posts/git-commit/
   -->
   
   
   
   <!-- Please keep an empty line above the dashes. -->
   ---
   **^ Add meaningful description above**
   Read the **[Pull Request Guidelines](https://github.com/apache/airflow/blob/main/contributing-docs/05_pull_requests.rst#pull-request-guidelines)** for more information.
   In case of fundamental code changes, an Airflow Improvement Proposal ([AIP](https://cwiki.apache.org/confluence/display/AIRFLOW/Airflow+Improvement+Proposals)) is needed.
   In case of a new dependency, check compliance with the [ASF 3rd Party License Policy](https://www.apache.org/legal/resolved.html#category-x).
   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 [airflow-core/newsfragments](https://github.com/apache/airflow/tree/main/airflow-core/newsfragments).
   


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


Re: [PR] AIP-81 feat (airflowctl): Initial airflowctl docs [airflow]

Posted by "bugraoz93 (via GitHub)" <gi...@apache.org>.
bugraoz93 commented on PR #49024:
URL: https://github.com/apache/airflow/pull/49024#issuecomment-2855144400

   > I am not sure why it is failing on the license checking 🤔
   > 
   > ```shell
   > ############################## Start docs build errors summary ##############################
   > ============================== apache-airflow-ctl ==============================
   > ------------------------------ Error   1 --------------------
   >  WARNING: Inline literal start-string without end-string.
   > File path: /opt/airflow/airflow-ctl/docs/installation/installing-from-sources.rst:1
   > >  1 |  .. Licensed to the Apache Software Foundation (ASF) under one
   >    2 |     or more contributor license agreements.  See the NOTICE file
   >    3 |     distributed with this work for additional information
   >    4 |     regarding copyright ownership.  The ASF licenses this file
   >    5 |     to you under the Apache License, Version 2.0 (the
   >    6 |     "License"); you may not use this file except in compliance
   > ############################## End docs build errors summary ##############################
   > The documentation has errors.
   > ####################  Packages errors summary  ####################
   > Package name                          Count of doc build errors    Count of spelling errors
   > ----------------------------------  ---------------------------  --------------------------
   > apache-airflow-ctl                            1                           0
   > ```
   
   This is fixed.


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


Re: [PR] AIP-81 feat (airflowctl): Initial airflowctl docs [airflow]

Posted by "gopidesupavan (via GitHub)" <gi...@apache.org>.
gopidesupavan commented on PR #49024:
URL: https://github.com/apache/airflow/pull/49024#issuecomment-2855206318

   I will look into this today.


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


Re: [PR] AIP-81 feat (airflowctl): Initial airflowctl docs [airflow]

Posted by "aritra24 (via GitHub)" <gi...@apache.org>.
aritra24 commented on PR #49024:
URL: https://github.com/apache/airflow/pull/49024#issuecomment-2856866844

   I can take a quick look later today


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


Re: [PR] AIP-81 feat (airflowctl): Initial airflowctl docs [airflow]

Posted by "bugraoz93 (via GitHub)" <gi...@apache.org>.
bugraoz93 commented on code in PR #49024:
URL: https://github.com/apache/airflow/pull/49024#discussion_r2072456516


##########
airflow-ctl/docs/cli-and-env-variables-ref.rst:
##########
@@ -0,0 +1,55 @@
+ .. 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.
+
+Command Line Interface and Environment Variables Reference
+==========================================================
+
+Command Line Interface
+''''''''''''''''''''''
+
+Airflow CTL has a very rich command line interface that allows for
+many types of operation on a DAG, starting services, and supporting
+development and testing.
+
+.. note::
+    For more information on usage CLI, see :doc:`/howto/usage-cli`
+
+.. contents:: Content
+    :local:
+    :depth: 2
+
+.. argparse::

Review Comment:
   Is this a thing in my local, encoding of examples, or do I need to fix something? :thinking: 
   
   ![Screenshot from 2025-05-03 21-55-53](https://github.com/user-attachments/assets/96ccb903-6535-42cc-8d48-656b7c209869)
   



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


Re: [PR] AIP-81 feat (airflowctl): Initial airflowctl docs [airflow]

Posted by "bugraoz93 (via GitHub)" <gi...@apache.org>.
bugraoz93 commented on code in PR #49024:
URL: https://github.com/apache/airflow/pull/49024#discussion_r2078356887


##########
airflow-ctl/docs/howto/index.rst:
##########
@@ -0,0 +1,77 @@
+ .. 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.
+
+
+
+How-to Guides
+=============
+
+Setting up the sandbox in the :doc:`/start` section was easy;
+building a production-grade environment requires a bit more work!
+
+These how-to guides will step you through common tasks in using and
+configuring an Airflow CTL environment.
+
+
+How to use Airflow CTL
+----------------------
+
+**Important Note**
+''''''''''''''''''
+Airflow CTL needs Airflow API running to be able to work. So see login section below before use.

Review Comment:
   I also included a couple of `Please` to make it more kind :) 



##########
airflow-ctl/docs/installation/installing-from-pypi.rst:
##########
@@ -0,0 +1,163 @@
+ .. 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.
+
+Installation from PyPI
+----------------------
+
+This page describes installations using the ``apache-airflow-ctl`` package `published in
+PyPI <https://pypi.org/project/apache-airflow/>`__.

Review Comment:
   Updated, thanks!



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


Re: [PR] AIP-81 feat (airflowctl): Initial airflowctl docs [airflow]

Posted by "bugraoz93 (via GitHub)" <gi...@apache.org>.
bugraoz93 commented on PR #49024:
URL: https://github.com/apache/airflow/pull/49024#issuecomment-2855318113

   > I will look into this today.
   
   Thanks, that would be amazing! The above problem that is related to CI docs build is fixed. I still see encoding problems in argparse generated docs, but let's merge this if it looks okay, and I can fix that as a next step. So, people contributing can also include docs 


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


Re: [PR] AIP-81 feat (airflowctl): Initial airflowctl docs [airflow]

Posted by "gopidesupavan (via GitHub)" <gi...@apache.org>.
gopidesupavan commented on code in PR #49024:
URL: https://github.com/apache/airflow/pull/49024#discussion_r2076184432


##########
airflow-ctl/docs/howto/index.rst:
##########
@@ -0,0 +1,77 @@
+ .. 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.
+
+
+
+How-to Guides
+=============
+
+Setting up the sandbox in the :doc:`/start` section was easy;
+building a production-grade environment requires a bit more work!
+
+These how-to guides will step you through common tasks in using and
+configuring an Airflow CTL environment.
+
+
+How to use Airflow CTL
+----------------------
+
+**Important Note**
+''''''''''''''''''
+Airflow CTL needs Airflow API running to be able to work. So see login section below before use.

Review Comment:
   ```suggestion
   Airflow CTL needs Airflow API running to be able to work. See login section below before use.
   ```



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


Re: [PR] AIP-81 feat (airflowctl): Initial airflowctl docs [airflow]

Posted by "gopidesupavan (via GitHub)" <gi...@apache.org>.
gopidesupavan commented on code in PR #49024:
URL: https://github.com/apache/airflow/pull/49024#discussion_r2076207319


##########
airflow-ctl/docs/installation/installing-from-pypi.rst:
##########
@@ -0,0 +1,163 @@
+ .. 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.
+
+Installation from PyPI
+----------------------
+
+This page describes installations using the ``apache-airflow-ctl`` package `published in
+PyPI <https://pypi.org/project/apache-airflow/>`__.

Review Comment:
   ```suggestion
   PyPI <https://pypi.org/project/apache-airflow-ctl/>`__.
   ```



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


Re: [PR] AIP-81 feat (airflowctl): Initial airflowctl docs [airflow]

Posted by "gopidesupavan (via GitHub)" <gi...@apache.org>.
gopidesupavan commented on PR #49024:
URL: https://github.com/apache/airflow/pull/49024#issuecomment-2855867631

   I am not native english speaker so someone can better word :) 


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


Re: [PR] AIP-81 feat (airflowctl): Initial airflowctl docs [airflow]

Posted by "bugraoz93 (via GitHub)" <gi...@apache.org>.
bugraoz93 commented on code in PR #49024:
URL: https://github.com/apache/airflow/pull/49024#discussion_r2078352925


##########
airflow-ctl/README.md:
##########
@@ -33,15 +33,37 @@ A command-line tool for interacting with Apache Airflow instances through the Ai
 
 - Python 3.9 or later (compatible with Python >= 3.9 and < 3.13)
 - Network access to an Apache Airflow instance with REST API enabled
+- Keyring backend installed in operating system for secure token storage
 
 ## Usage
 
 Access the tool from your terminal:
 
+### Command Line
+
 ```bash
 airflowctl --help
 ```
 
 ## Contributing
 
 Want to help improve Apache Airflow? Check out our [contributing documentation](https://github.com/apache/airflow/blob/main/contributing-docs/README.rst).
+
+### Additional Contribution Guidelines
+
+- Please ensure API is running while doing development testing.
+- There are two ways to have a CLI command,
+  - Auto Generated Commands
+  - Implemented Commands
+
+#### Auto Generated Commands
+
+Auto generation of commands directly from operations methods under `airflow-ctl/src/airflowctl/api/operations.py`.
+Whenever operation is mapped with proper datamodel and response model, it will be automatically added to the command.
+
+You can check each command with `airflowctl <command> --help` to see the available options.
+

Review Comment:
   It is a good idea. I think rather than adding the screenshot taken from local, we should auto-generate it. 
   How about I do that as a next step to not increase the LoC on this PR? 
   Because when I check Breeze, I think I need to tweak a bit, because Breeze is only creating images for Breeze. Since `airflowctl` will be user-facing, the generated images shouldn't be implemented in there so I will add a pre-commit hook to achieve this.  



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


Re: [PR] AIP-81 feat (airflowctl): Initial airflowctl docs [airflow]

Posted by "bugraoz93 (via GitHub)" <gi...@apache.org>.
bugraoz93 commented on PR #49024:
URL: https://github.com/apache/airflow/pull/49024#issuecomment-2849596622

   I am not sure why it is failing on the license checking :thinking: 
   ```bash
   ############################## Start docs build errors summary ##############################
   ============================== apache-airflow-ctl ==============================
   ------------------------------ Error   1 --------------------
    WARNING: Inline literal start-string without end-string.
   File path: /opt/airflow/airflow-ctl/docs/installation/installing-from-sources.rst:1
   >  1 |  .. Licensed to the Apache Software Foundation (ASF) under one
      2 |     or more contributor license agreements.  See the NOTICE file
      3 |     distributed with this work for additional information
      4 |     regarding copyright ownership.  The ASF licenses this file
      5 |     to you under the Apache License, Version 2.0 (the
      6 |     "License"); you may not use this file except in compliance
   ############################## End docs build errors summary ##############################
   The documentation has errors.
   ####################  Packages errors summary  ####################
   Package name                          Count of doc build errors    Count of spelling errors
   ----------------------------------  ---------------------------  --------------------------
   apache-airflow-ctl                            1                           0
   ```


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


Re: [PR] AIP-81 feat (airflowctl): Initial airflowctl docs [airflow]

Posted by "gopidesupavan (via GitHub)" <gi...@apache.org>.
gopidesupavan commented on PR #49024:
URL: https://github.com/apache/airflow/pull/49024#issuecomment-2855863542

   Over all LGTM, anyone would like to take another pass. :)


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


Re: [PR] AIP-81 feat (airflowctl): Initial airflowctl docs [airflow]

Posted by "gopidesupavan (via GitHub)" <gi...@apache.org>.
gopidesupavan commented on code in PR #49024:
URL: https://github.com/apache/airflow/pull/49024#discussion_r2076164385


##########
airflow-ctl/README.md:
##########
@@ -33,15 +33,37 @@ A command-line tool for interacting with Apache Airflow instances through the Ai
 
 - Python 3.9 or later (compatible with Python >= 3.9 and < 3.13)
 - Network access to an Apache Airflow instance with REST API enabled
+- Keyring backend installed in operating system for secure token storage
 
 ## Usage
 
 Access the tool from your terminal:
 
+### Command Line
+
 ```bash
 airflowctl --help
 ```
 
 ## Contributing
 
 Want to help improve Apache Airflow? Check out our [contributing documentation](https://github.com/apache/airflow/blob/main/contributing-docs/README.rst).
+
+### Additional Contribution Guidelines
+
+- Please ensure API is running while doing development testing.
+- There are two ways to have a CLI command,
+  - Auto Generated Commands
+  - Implemented Commands
+
+#### Auto Generated Commands
+
+Auto generation of commands directly from operations methods under `airflow-ctl/src/airflowctl/api/operations.py`.
+Whenever operation is mapped with proper datamodel and response model, it will be automatically added to the command.
+
+You can check each command with `airflowctl <command> --help` to see the available options.
+

Review Comment:
   Better to add a screenshot of airflowctl --help ?



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