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

promote-charm: doc-automation-disabled unexpectedly requires Discourse creds #400

Open
andrei-polukhin opened this issue Aug 29, 2024 · 0 comments

Comments

@andrei-polukhin
Copy link

Dear team!

I am using the promote_charm.yaml GitHub workflow, but I have a weird experience using the doc-automation-disabled: true parameter. My expectation is that the Publish docs step is fully skipped, but it doesn't appear to be the case:

publish-docs:
if: ${{ github.event.inputs.destination-channel }} == 'latest/stable'

Instead, this input is thrown into the dry_run parameter, which looks a bit weird to me:

dry_run: ${{ inputs.doc-automation-disabled }}

The problem with this approach is that I do not want any documentation to be published, which is clearly shown as the description to my parameter, but when running with the documentation disabled and w/o Discourse credentials, I get the following error in the GitHub workflow:

INFO:root:Base branch: main (commit e01531f185ba35cc35fbce909436923d6e69fc0c)
Traceback (most recent call last):
  File "/usr/src/app/main.py", line 257, in <module>
    main()
  File "/usr/src/app/main.py", line 240, in main
    assert main_checks(user_inputs=user_inputs)  # pylint: disable=no-value-for-parameter
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/app/main.py", line 170, in wrapper
    output = func(execute_cwd, *args, **kwargs)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/app/main.py", line 224, in main_checks
    clients = get_clients(user_inputs, path)
              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/app/src/clients.py", line 38, in get_clients
    discourse=create_discourse(
              ^^^^^^^^^^^^^^^^^
  File "/usr/src/app/src/discourse.py", line 541, in create_discourse
    raise InputError(
src.exceptions.InputError: Invalid 'discourse_api_username' input, it must be non-empty, got api_username=''

Could we change the if condition for the Publish docs step so that it does not run on doc-automation-disabled: true? Here is my GitHub workflow file for posterity: https://github.com/canonical/pro-airgapped/blob/e01531f185ba35cc35fbce909436923d6e69fc0c/.github/workflows/charm-promotion.yml

Thank you very much in advance!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant