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

Fix for Issue #165 missing themes #169

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

adrinux
Copy link
Contributor

@adrinux adrinux commented Jul 3, 2024

This does the following:

  • Updates the list of themes for gitea and forgejo to match upstream
  • Moves the theme vars into per fork files
  • Loads the theme vars based on the value of the gitea_fork var
  • Updates the README section on default UI vars to match these changes

It's been tested:

  • running Ansible on a manjaro Linux host against a Debian 12 VM, with Forgejo as the specified fork.
  • Leaving the vars as default resulted in the correct forgejo-auto theme being used and fixed my original issue Forgejo installs now have theme issues, lack theming #165
  • A second run overriding gitea_theme_default to forgejo-dark in my local host_vars worked as expected.
  • The full list of themes was available in the Forgejo web UI user settings and worked when selected.

I have not yet tested Gitea and will likely not have time for several weeks.

@adrinux
Copy link
Contributor Author

adrinux commented Jul 3, 2024

I personally ignore yamllint errors about line length. Has no effect on functionality and editors can wrap.

Forgejo has a long list of themes. What can I do? I have no idea how to fix this in YAML and still leave it as a comma separated list of themes. Suggestions welcome.

@adrinux
Copy link
Contributor Author

adrinux commented Jul 3, 2024

Is it possible to have that action set line length to a warning instead of an error?

I see the custom yamllint in the project already sets it as a warning and 190 chars.
This line of forgejo themes is 276 chars - but it seems the action is still treating the violation as an error, not just a warning.

Maybe the warning the action posts about an incompatible yamllint config causes the problem?

WARNING  Found incompatible custom yamllint configuration (.yamllint), please either remove the file or edit it to comply with:
  - comments.min-spaces-from-content must be 1
  - comments-indentation must be false
  - braces.max-spaces-inside must be 1
  - octal-values.forbid-implicit-octal must be true
  - octal-values.forbid-explicit-octal must be true.

@adrinux
Copy link
Contributor Author

adrinux commented Jul 3, 2024

It seems ansible-lint treats all reports from yamllint as errors regardless of whether yamllint reports them as error or warning. Essentially ansible-lint is ignoring the yamllint config.

I think the solution may be to add line-length to warn_list in an .ansible-lint file? See ansible-lint docs.

@adrinux
Copy link
Contributor Author

adrinux commented Jul 3, 2024

Added yamllint magic comments to ignore line-length for the forgejo themes var. Like so:

gitea_theme_default: "forgejo-auto"
# yamllint disable rule:line-length
gitea_themes: "forgejo-auto,forgejo-light,forgejo-dark,gitea-auto,gitea-light,gitea-dark,forgejo-auto-deuteranopia-protanopia,forgejo-light-deuteranopia-protanopia,forgejo-dark-deuteranopia-protanopia,forgejo-auto-tritanopia,forgejo-light-tritanopia,forgejo-dark-tritanopia"
# yamllint enable rule:line-length

As a workaround. Now passes the ansible-lint action check.
Hope that is ok.

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

Successfully merging this pull request may close these issues.

None yet

1 participant