Skip to content

Transition of list airflowctl config command #50292

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

Merged

Conversation

yunchipang
Copy link
Contributor

partially closes: #45664
parent issue: #45661

implements list config command by adding a list method to ConfigOperations.

@yunchipang
Copy link
Contributor Author

@bugraoz93 referencing our discussion in #49601, could you please take a look if this implementation of airflowctl's list config command is on the right track?

Copy link
Contributor

@bugraoz93 bugraoz93 left a comment

Choose a reason for hiding this comment

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

Thanks for the update! Direction is good. The only thing is there is no direct list command. We either need to utilise get and loop through the entire configuration or implement a simple list on the API side and keep these newly added pieces
See endpoints: https://github.com/apache/airflow/blob/main/airflow-core%2Fsrc%2Fairflow%2Fapi_fastapi%2Fcore_api%2Froutes%2Fpublic%2Fconfig.py

@yunchipang
Copy link
Contributor Author

@bugraoz93 Thanks for the review!

Just wanted to clarify—I was using the endpoint below to get all configs while implementing the list command, and it seemed to be working as expected:

This is the what the current list command gets me.

root@24ae150ff6a0:/opt/airflow# airflowctl config list
Please enter password for encrypted keyring:
Config(
    sections=[
        ConfigSection(
            name='atlas',
            options=[
                ConfigOption(key='sasl_enabled', value='False'),
                ConfigOption(key='host', value=''),
                ConfigOption(key='port', value='21000'),
                ConfigOption(key='username', value=''),
                ConfigOption(key='password', value='')
            ]
        ),
        ConfigSection(
            name='hive',
            options=[ConfigOption(key='default_hive_mapred_queue', value='')]
        ),
        ...

If the goal is to format it more like this:

[core]
dags_folder = /opt/airflow/dags
base_log_folder = /opt/airflow/logs
...

Would it be correct to assume this is just a matter of formatting? Or am I missing something deeper in the implementation? Happy to adjust if needed—just want to make sure I fully understand your feedback. Appreciate your insights!

@bugraoz93
Copy link
Contributor

Exactly, this is the case. In this one, directly calling the API endpoint is returning what we want, so only implementing the operations is enough in this case.
Format is okay for now, we are just using rich.print() for all generated ones, and we will do a bulk update later for formatting with one line below.

rich.print(operation_method_object(method_params))

We only need to add and update a small part in the unit test for operations. Direction is good. Thanks for the update!

@yunchipang yunchipang changed the title [WIP] transition of list airflowctl config command Transition of list airflowctl config command May 8, 2025
@yunchipang yunchipang marked this pull request as ready for review May 8, 2025 22:59
@yunchipang yunchipang requested review from kaxil and potiuk as code owners May 8, 2025 22:59
@yunchipang yunchipang requested a review from bugraoz93 May 8, 2025 22:59
Copy link
Contributor

@bugraoz93 bugraoz93 left a comment

Choose a reason for hiding this comment

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

Looks great! Thanks!

@bugraoz93 bugraoz93 force-pushed the airflowctl-transition-list-config-command branch from b4687e2 to 2343dd4 Compare May 12, 2025 20:43
@bugraoz93 bugraoz93 merged commit 4828d48 into apache:main May 12, 2025
8 checks passed
@yunchipang yunchipang deleted the airflowctl-transition-list-config-command branch May 12, 2025 23:32
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.

AIP-81 Transition of Config Command
2 participants