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

Closed
andrei-polukhin opened this issue Aug 29, 2024 · 1 comment · Fixed by #463
Closed
Assignees

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!

@cbartz
Copy link
Contributor

cbartz commented Nov 5, 2024

Hi, thanks for bringing this up. This is not an easy decision to make, as I think we (Platform Engineering) might still want to use the dry_run parameter to see what would happen if we actually tried to publish the docs before eventually setting doc-automation-disabled to true. We'll discuss this internally. Thank you very much.

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

Successfully merging a pull request may close this issue.

3 participants