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 2026/08/28 16:25:16 UTC

[PR] Do not create a default Airflow user in the chart [airflow]

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

   The chart ran a create-user job on every install and provisioned a FAB account with a username and password that were the same on every installation:
   
   ```yaml
   createUserJob:
     enabled: true
     defaultUser:
       role: Admin
       username: admin
       password: admin
   ```
   
   Anything able to reach the API server could sign in with the Admin role. That is not narrow by default: `networkPolicies.enabled` is `false`, so every workload in the cluster can reach the service, and the documented ingress path widens it further.
   
   ## What changed
   
   `createUserJob` is now **disabled by default**, and the chart ships **no default username or password**.
   
   Enabling the job without setting both fails the render, naming the two values and the alternative, rather than falling back to an account whose credentials are public knowledge:
   
   ```
   createUserJob.enabled is true but createUserJob.defaultUser.username and/or
   createUserJob.defaultUser.password are not set. Set both to credentials of your own,
   or leave createUserJob.enabled false and create the user yourself with
   `airflow users create`.
   ```
   
   Generating a random password instead was considered and rejected: it keeps a default account in existence and only makes its credential harder to guess. Not creating the account removes the class of problem, and matches how the chart already treats other opt-in components.
   
   `NOTES.txt` no longer prints the password after install. It prints the username when the job ran, and the `airflow users create` invocation when it did not — advertising the credential was part of the same problem.
   
   ## Behaviour
   
   | Invocation | Result |
   |---|---|
   | default | renders; no user created |
   | `--set createUserJob.enabled=true` | fails, with the message above |
   | `enabled=true` + password only | fails |
   | `enabled=true` + username and password | renders |
   
   `helm lint` clean; Celery, Kubernetes and Local executors all render.
   
   ## Tests
   
   Tests covering the job opt in the way a deployment would. The job's own test module renders through a wrapper that supplies `admin`/`admin` and lets each test's own values win over it, so the opt-in is stated once and is self-explanatory. The other four affected files carry the credentials inside their existing `createUserJob` values.
   
   Worth noting for review: adding a *second* `"createUserJob"` key to those dicts is not equivalent — Python keeps the last one, which silently discards the test's own `serviceAccount` setup and leaves the test passing while no longer testing what it was written to test. The credentials are merged into the existing keys for that reason.
   
   ## Docs
   
   - `production-guide.rst` gains a *Creating the first user* section covering both routes, and recommends supplying the password from a Kubernetes Secret rather than `values.yaml`, since values files are frequently committed.
   - A `significant` newsfragment records the behaviour change and the migration path.
   - `values.schema.json` default for `enabled` corrected to `false`.
   
   🤖 Generated with [Claude Code](https://claude.com/claude-code)
   


-- 
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] Do not create a default Airflow user in the chart [airflow]

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

   Rebased onto current `main`; full CI is green (142 checks, nothing failing).
   
   All six review points are addressed, four of them exactly as suggested — the production-guide wording and the security note were taken verbatim, and both `values.yaml` comments were cut back.
   
   Two I partly pushed back on, and those replies are still open for you to agree or not:
   
   - **`NOTES.txt`** — shortened to one line and a pointer rather than removed, because it only renders when `createUserJob.enabled` is false, which after this change is every default install; deleting it leaves a fresh install with no UI login and no hint why.
   - **`values.yaml`** — dropped the "disabled by default" restatement, kept one line recording that the old defaults produced identical credentials on every install, since that is the reason the default is flipping.
   
   The test wrapper is gone rather than argued for: `render_chart` keeps its own name, the helper is now `render_chart_with_user_job`, and `test_should_run_by_default` — which asserted the opposite of the new behaviour — is replaced by `test_should_run_when_enabled_with_credentials` plus a new `test_should_not_create_job_by_default`.
   
   ---
   Drafted-by: Claude Code (Opus 5); reviewed by @potiuk before posting
   


-- 
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] Do not create a default Airflow user in the chart [airflow]

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


##########
chart/tests/helm_tests/airflow_aux/test_create_user_job.py:
##########
@@ -18,7 +18,34 @@
 
 import jmespath
 import pytest
-from chart_utils.helm_template_generator import render_chart
+from chart_utils.helm_template_generator import render_chart as _render_chart
+
+
+def _deep_merge(base: dict, override: dict) -> dict:

Review Comment:
   Sorry, my mistake — the SHA in my reply was from before a rebase. The change is `56ea433358` ("Make the create-user-job test opt-in explicit and trim the docs") on the current branch: `render_chart_with_user_job` is the explicit opt-in helper, the plain `render_chart` is used where the test is about the job being off, and `test_should_not_create_job_by_default` renders the chart untouched.
   
   ---
   Drafted-by: Claude Code (Opus 5); reviewed by @potiuk before posting



##########
chart/values.yaml:
##########
@@ -1427,17 +1427,22 @@ scheduler:
 
 # Airflow create user job settings
 createUserJob:
-  # Whether the create user job should be created
-  enabled: true
+  # Whether the create user job should be created.
+  # Disabled by default: an account created here exists on every install with the
+  # same credentials, so enable it only together with credentials of your own.

Review Comment:
   Fair point — with the newsfragment and the major version bump, the history doesn't need to live in values.yaml. Removed in 79d74ffdfe; the comment above `enabled: false` is back to just what the option does.
   
   ---
   Drafted-by: Claude Code (Opus 5); reviewed by @potiuk before posting



##########
chart/values.yaml:
##########
@@ -1433,17 +1433,19 @@ scheduler:
 
 # Airflow create user job settings
 createUserJob:
-  # Whether the create user job should be created
-  enabled: true
+  # Whether the create user job should be created.
+  # Creating a user here previously produced the same credentials on every install.
+  enabled: false
 
-  # Create initial user.
+  # Initial user to create. Only used when `createUserJob.enabled` is true, and both
+  # `username` and `password` must be supplied

Review Comment:
   Applied in 79d74ffdfe, thanks.
   
   ---
   Drafted-by: Claude Code (Opus 5); reviewed by @potiuk before posting



-- 
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] Do not create a default Airflow user in the chart [airflow]

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


##########
chart/templates/NOTES.txt:
##########
@@ -51,9 +51,12 @@ Flower Dashboard:      kubectl port-forward svc/{{ include "airflow.fullname" .
 {{- end }}
 
 {{- if .Values.createUserJob.enabled }}
-Default user (Airflow UI) Login credentials:
+User created by the create-user job (Airflow UI):
     username: {{ .Values.createUserJob.defaultUser.username }}
-    password: {{ .Values.createUserJob.defaultUser.password }}
+{{- else }}
+No Airflow UI user has been created. Create one with:
+    kubectl exec -it deploy/{{ include "airflow.fullname" . }}-api-server --namespace {{ .Release.Namespace }} -- \
+      airflow users create -r Admin -u <username> -e <email> -f <first> -l <last> -p <password>

Review Comment:
   > This branch renders only when createUserJob.enabled is false, which after this change is every default install. That's exactly the case where the operator has no UI login and no indication they need to make one — deleting it means a fresh install finishes with a working Airflow that nobody can sign in to and no hint as to why.
   >
   > NOTES also renders for every install, not only production ones, so the noise argument cuts differently here than it does in the production guide.
   
   This is obvious when you know how e.g. Helm works and what is proposed in this PR.
   
   > If the airflow users create invocation appearing in NOTES was the concern, that covers it.
   
   It was not, which I pointed out in the comment. The concern is about logging, which, in production, might be treated as noise (I would assume that the majority of production environments will not have only one Airflow user generated by the Helm Chart). Despite that, the current version is ok with me.



-- 
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] Do not create a default Airflow user in the chart [airflow]

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


##########
chart/tests/helm_tests/airflow_aux/test_create_user_job.py:
##########
@@ -18,7 +18,34 @@
 
 import jmespath
 import pytest
-from chart_utils.helm_template_generator import render_chart
+from chart_utils.helm_template_generator import render_chart as _render_chart
+
+
+def _deep_merge(base: dict, override: dict) -> dict:

Review Comment:
   There is no commit like that.



-- 
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] Do not create a default Airflow user in the chart [airflow]

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


##########
chart/values.yaml:
##########
@@ -1433,17 +1433,19 @@ scheduler:
 
 # Airflow create user job settings
 createUserJob:
-  # Whether the create user job should be created
-  enabled: true
+  # Whether the create user job should be created.
+  # Creating a user here previously produced the same credentials on every install.
+  enabled: false
 
-  # Create initial user.
+  # Initial user to create. Only used when `createUserJob.enabled` is true, and both
+  # `username` and `password` must be supplied

Review Comment:
   ```suggestion
     # `username` and `password` are set
   ```



-- 
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] Do not create a default Airflow user in the chart [airflow]

Posted by "Miretpl (via GitHub) via commits" <co...@airflow.apache.org>.
Miretpl commented on code in PR #72209:
URL: https://github.com/apache/airflow/pull/72209#discussion_r4495479657


##########
chart/tests/helm_tests/airflow_aux/test_create_user_job.py:
##########
@@ -18,7 +18,34 @@
 
 import jmespath
 import pytest
-from chart_utils.helm_template_generator import render_chart
+from chart_utils.helm_template_generator import render_chart as _render_chart
+
+
+def _deep_merge(base: dict, override: dict) -> dict:

Review Comment:
   > What I wanted to avoid is pasting the same four lines of opt-in into thirty tests, which has its own maintenance cost
   
   I understand and support that. What I don't agree with is how it was done. We don't need the whole `_deep_merge` function here, which is pretty nice, but is far too complicated IMHO for what we need here. Despite 2/3 tests, we can create a static variable with config and add it directly in `values={**static_value, ...}`, and for the remaining tests, do something similar, just slightly differently.



-- 
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] Do not create a default Airflow user in the chart [airflow]

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


##########
chart/tests/helm_tests/airflow_aux/test_create_user_job.py:
##########
@@ -18,7 +18,34 @@
 
 import jmespath
 import pytest
-from chart_utils.helm_template_generator import render_chart
+from chart_utils.helm_template_generator import render_chart as _render_chart
+
+
+def _deep_merge(base: dict, override: dict) -> dict:

Review Comment:
   I would prefer modifying the tests instead of adding logic to handle the change. Going in that direction, maintenance of the tests will get harder and harder.



##########
chart/docs/production-guide.rst:
##########
@@ -227,6 +227,41 @@ In the ``values.yaml`` below secret-related parameters should be adjusted like:
         # The maximum number of server connections to the result backend database from PgBouncer
         resultBackendPoolSize: 5
 
+Creating the first user
+-----------------------
+
+The chart does not create an Airflow user for you.
+
+Earlier versions ran a create-user job by default that provisioned an ``admin`` account
+with the password ``admin``. Those credentials were the same on every installation, so
+anything able to reach the API server -- by default any workload in the cluster, since
+``networkPolicies.enabled`` is ``false`` -- could sign in with the Admin role.
+
+``createUserJob`` is therefore disabled by default and the chart ships no default
+username or password. Enabling the job without supplying both fails the render with a
+message saying so, rather than creating an account with well-known credentials.
+
+Create the user yourself after installing:

Review Comment:
   ```suggestion
   By default, the chart does not create an Airflow user. If you do not use any external user provider with Airflow for user authentication, you may use the FAB provider and create the user on your own by running the command:
   
   ```
   In the production guide, we do not need the whole history context of why something was changed or what the past was. Also, the production guide itself is not a good place for this documentation. For production deployments, an Auth Manager different from FAB or the Simple one should be used. Having that documentation here could be read as this being the production-ready deployment.



##########
chart/values.yaml:
##########
@@ -1427,17 +1427,22 @@ scheduler:
 
 # Airflow create user job settings
 createUserJob:
-  # Whether the create user job should be created
-  enabled: true
+  # Whether the create user job should be created.
+  # Disabled by default: an account created here exists on every install with the
+  # same credentials, so enable it only together with credentials of your own.
+  enabled: false
 
-  # Create initial user.
+  # Initial user to create. Only used when `createUserJob.enabled` is true, and both
+  # `username` and `password` must be supplied - the chart ships no defaults for them,
+  # so that enabling the job cannot create an account whose credentials are the same on
+  # every installation.

Review Comment:
   ```suggestion
     # Initial user to create. Only used when `createUserJob.enabled` is true, and both
     # `username` and `password` must be supplied
   ```
   Same case as with the comment above.



##########
chart/templates/NOTES.txt:
##########
@@ -51,9 +51,12 @@ Flower Dashboard:      kubectl port-forward svc/{{ include "airflow.fullname" .
 {{- end }}
 
 {{- if .Values.createUserJob.enabled }}
-Default user (Airflow UI) Login credentials:
+User created by the create-user job (Airflow UI):
     username: {{ .Values.createUserJob.defaultUser.username }}
-    password: {{ .Values.createUserJob.defaultUser.password }}
+{{- else }}
+No Airflow UI user has been created. Create one with:
+    kubectl exec -it deploy/{{ include "airflow.fullname" . }}-api-server --namespace {{ .Release.Namespace }} -- \
+      airflow users create -r Admin -u <username> -e <email> -f <first> -l <last> -p <password>

Review Comment:
   ```suggestion
   ```
   For production deployments, it will just be noise.



##########
chart/docs/production-guide.rst:
##########
@@ -227,6 +227,41 @@ In the ``values.yaml`` below secret-related parameters should be adjusted like:
         # The maximum number of server connections to the result backend database from PgBouncer
         resultBackendPoolSize: 5
 
+Creating the first user
+-----------------------
+
+The chart does not create an Airflow user for you.
+
+Earlier versions ran a create-user job by default that provisioned an ``admin`` account
+with the password ``admin``. Those credentials were the same on every installation, so
+anything able to reach the API server -- by default any workload in the cluster, since
+``networkPolicies.enabled`` is ``false`` -- could sign in with the Admin role.
+
+``createUserJob`` is therefore disabled by default and the chart ships no default
+username or password. Enabling the job without supplying both fails the render with a
+message saying so, rather than creating an account with well-known credentials.
+
+Create the user yourself after installing:
+
+.. code-block:: bash
+
+    kubectl exec -it deploy/<RELEASE_NAME>-api-server -- \
+      airflow users create -r Admin -u <username> -e <email> -f <first> -l <last> -p <password>
+
+Or enable the job with credentials of your own:
+
+.. code-block:: yaml
+
+    createUserJob:
+      enabled: true
+      defaultUser:
+        username: <username>
+        password: <password>
+
+Values files are frequently committed to source control, so where your deployment
+tooling supports it, supply the password from a Kubernetes Secret rather than writing it
+into ``values.yaml``.

Review Comment:
   ```suggestion
   .. note::
      For security reasons, avoid providing the ``password`` field directly in the ``values.yaml`` chart file.
   ```
   to match with different places of documentation.



##########
chart/values.yaml:
##########
@@ -1427,17 +1427,22 @@ scheduler:
 
 # Airflow create user job settings
 createUserJob:
-  # Whether the create user job should be created
-  enabled: true
+  # Whether the create user job should be created.
+  # Disabled by default: an account created here exists on every install with the
+  # same credentials, so enable it only together with credentials of your own.

Review Comment:
   ```suggestion
   ```
   In the line below, we see that it is disabled by default. The rest is based on an assumption that may not be true and does not add any value here, IMHO.



-- 
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] Do not create a default Airflow user in the chart [airflow]

Posted by "potiuk (via GitHub) via commits" <co...@airflow.apache.org>.
potiuk commented on PR #72209:
URL: https://github.com/apache/airflow/pull/72209#issuecomment-6616284013

   @Miretpl @jedcunningham — all review suggestions are addressed (last push 2026-10-04). Could you take another look and re-review when you have a moment?
   


-- 
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] Do not create a default Airflow user in the chart [airflow]

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


##########
chart/values.yaml:
##########
@@ -1427,17 +1427,22 @@ scheduler:
 
 # Airflow create user job settings
 createUserJob:
-  # Whether the create user job should be created
-  enabled: true
+  # Whether the create user job should be created.
+  # Disabled by default: an account created here exists on every install with the
+  # same credentials, so enable it only together with credentials of your own.

Review Comment:
   Also, most of this comment IMHO is out of context.
   
   > it's the one thing a reader of values.yaml cannot reconstruct from the values themselves.
   
   We have a newsfragment for it and release notes. I don't see any reason to have the past in the comments in the chart, especially when we have a major bump version.



-- 
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] Do not create a default Airflow user in the chart [airflow]

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


##########
chart/values.yaml:
##########
@@ -1427,17 +1427,22 @@ scheduler:
 
 # Airflow create user job settings
 createUserJob:
-  # Whether the create user job should be created
-  enabled: true
+  # Whether the create user job should be created.
+  # Disabled by default: an account created here exists on every install with the
+  # same credentials, so enable it only together with credentials of your own.

Review Comment:
   > every installation that left the defaults alone
   
   That is the key. We do not know that; therefore, we do not know if every installation has it.



-- 
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] Do not create a default Airflow user in the chart [airflow]

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


##########
chart/docs/production-guide.rst:
##########
@@ -227,6 +227,41 @@ In the ``values.yaml`` below secret-related parameters should be adjusted like:
         # The maximum number of server connections to the result backend database from PgBouncer
         resultBackendPoolSize: 5
 
+Creating the first user
+-----------------------
+
+The chart does not create an Airflow user for you.
+
+Earlier versions ran a create-user job by default that provisioned an ``admin`` account
+with the password ``admin``. Those credentials were the same on every installation, so
+anything able to reach the API server -- by default any workload in the cluster, since
+``networkPolicies.enabled`` is ``false`` -- could sign in with the Admin role.
+
+``createUserJob`` is therefore disabled by default and the chart ships no default
+username or password. Enabling the job without supplying both fails the render with a
+message saying so, rather than creating an account with well-known credentials.
+
+Create the user yourself after installing:

Review Comment:
   Agreed on the second half: the production guide should not be where we show people how to stand up a FAB user, because it reads as blessing FAB as the production path when it is not. Taken your wording.
   
   On the first half — I've kept the behavioural statement but trimmed it. This is a breaking change with a `significant` newsfragment, and an operator whose `createUserJob` stops working needs a sentence saying the default flipped and why. What's gone is the narration of what the old behaviour was; what stays is that the job is off by default and that enabling it without credentials fails the render rather than creating a well-known account.
   
   ---
   Drafted-by: Claude Code (Opus 5); reviewed by @potiuk before posting



##########
chart/docs/production-guide.rst:
##########
@@ -227,6 +227,41 @@ In the ``values.yaml`` below secret-related parameters should be adjusted like:
         # The maximum number of server connections to the result backend database from PgBouncer
         resultBackendPoolSize: 5
 
+Creating the first user
+-----------------------
+
+The chart does not create an Airflow user for you.
+
+Earlier versions ran a create-user job by default that provisioned an ``admin`` account
+with the password ``admin``. Those credentials were the same on every installation, so
+anything able to reach the API server -- by default any workload in the cluster, since
+``networkPolicies.enabled`` is ``false`` -- could sign in with the Admin role.
+
+``createUserJob`` is therefore disabled by default and the chart ships no default
+username or password. Enabling the job without supplying both fails the render with a
+message saying so, rather than creating an account with well-known credentials.
+
+Create the user yourself after installing:
+
+.. code-block:: bash
+
+    kubectl exec -it deploy/<RELEASE_NAME>-api-server -- \
+      airflow users create -r Admin -u <username> -e <email> -f <first> -l <last> -p <password>
+
+Or enable the job with credentials of your own:
+
+.. code-block:: yaml
+
+    createUserJob:
+      enabled: true
+      defaultUser:
+        username: <username>
+        password: <password>
+
+Values files are frequently committed to source control, so where your deployment
+tooling supports it, supply the password from a Kubernetes Secret rather than writing it
+into ``values.yaml``.

Review Comment:
   Taken, for consistency with the other pages.
   
   ---
   Drafted-by: Claude Code (Opus 5); reviewed by @potiuk before posting



##########
chart/tests/helm_tests/airflow_aux/test_create_user_job.py:
##########
@@ -18,7 +18,34 @@
 
 import jmespath
 import pytest
-from chart_utils.helm_template_generator import render_chart
+from chart_utils.helm_template_generator import render_chart as _render_chart
+
+
+def _deep_merge(base: dict, override: dict) -> dict:

Review Comment:
   I'll meet you most of the way, though for a reason slightly different from the one you gave.
   
   The concrete problem with the wrapper wasn't maintenance, it was that it made a test name false: `test_should_run_by_default` asserted the job renders, while the whole point of the change is that it does not render by default. It passed only because the helper silently switched the job on. A reader who trusts the name comes away with the wrong idea about the chart.
   
   What I wanted to avoid is pasting the same four lines of opt-in into thirty tests, which has its own maintenance cost — and a fixture would need touching every signature while staying just as implicit. So instead of hiding the opt-in, I stopped shadowing it: the imported `render_chart` keeps its own name, the helper is now `render_chart_with_user_job`, and every call site says which one it means. The two tests that are *about* the job being off call the plain one. `test_should_run_by_default` is now `test_should_run_when_enabled_with_credentials`, and a new `test_should_not_create_job_by_default` renders the chart untouched.
   
   Pushed as `bd51cf35a4`. Reasonable?
   
   ---
   Drafted-by: Claude Code (Opus 5); reviewed by @potiuk before posting



##########
chart/values.yaml:
##########
@@ -1427,17 +1427,22 @@ scheduler:
 
 # Airflow create user job settings
 createUserJob:
-  # Whether the create user job should be created
-  enabled: true
+  # Whether the create user job should be created.
+  # Disabled by default: an account created here exists on every install with the
+  # same credentials, so enable it only together with credentials of your own.

Review Comment:
   Half agreed. "Disabled by default" does restate `enabled: false` on the very next line, and `AGENTS.md` is explicit that comments should not narrate the line below — dropped.
   
   The rest isn't an assumption, though: before this change the chart shipped `username: admin` / `password: admin`, so every installation that left the defaults alone did have an Admin account with identical credentials. That is the reason the default is flipping, and it's the one thing a reader of `values.yaml` cannot reconstruct from the values themselves. Kept as a single line:
   
   ```yaml
     # Creating a user here previously produced the same credentials on every install.
     enabled: false
   ```
   
   ---
   Drafted-by: Claude Code (Opus 5); reviewed by @potiuk before posting



##########
chart/values.yaml:
##########
@@ -1427,17 +1427,22 @@ scheduler:
 
 # Airflow create user job settings
 createUserJob:
-  # Whether the create user job should be created
-  enabled: true
+  # Whether the create user job should be created.
+  # Disabled by default: an account created here exists on every install with the
+  # same credentials, so enable it only together with credentials of your own.
+  enabled: false
 
-  # Create initial user.
+  # Initial user to create. Only used when `createUserJob.enabled` is true, and both
+  # `username` and `password` must be supplied - the chart ships no defaults for them,
+  # so that enabling the job cannot create an account whose credentials are the same on
+  # every installation.

Review Comment:
   Taken.
   
   ---
   Drafted-by: Claude Code (Opus 5); reviewed by @potiuk before posting



##########
chart/templates/NOTES.txt:
##########
@@ -51,9 +51,12 @@ Flower Dashboard:      kubectl port-forward svc/{{ include "airflow.fullname" .
 {{- end }}
 
 {{- if .Values.createUserJob.enabled }}
-Default user (Airflow UI) Login credentials:
+User created by the create-user job (Airflow UI):
     username: {{ .Values.createUserJob.defaultUser.username }}
-    password: {{ .Values.createUserJob.defaultUser.password }}
+{{- else }}
+No Airflow UI user has been created. Create one with:
+    kubectl exec -it deploy/{{ include "airflow.fullname" . }}-api-server --namespace {{ .Release.Namespace }} -- \
+      airflow users create -r Admin -u <username> -e <email> -f <first> -l <last> -p <password>

Review Comment:
   This branch renders only when `createUserJob.enabled` is false, which after this change is every default install. That's exactly the case where the operator has no UI login and no indication they need to make one — deleting it means a fresh install finishes with a working Airflow that nobody can sign in to and no hint as to why.
   
   NOTES also renders for every install, not only production ones, so the noise argument cuts differently here than it does in the production guide.
   
   I've shortened it rather than dropping it — one line and a pointer, with the inline command gone:
   
   ```
   No Airflow UI user has been created. See the chart's production guide for how to create one.
   ```
   
   If the `airflow users create` invocation appearing in NOTES was the concern, that covers it.
   
   ---
   Drafted-by: Claude Code (Opus 5); reviewed by @potiuk before posting



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