Skip to content

Add Scylla Sphinx Theme 1.0#815

Closed
dgarcia360 wants to merge 16 commits intoscylladb:masterfrom
dgarcia360:update-docs-theme-1.0
Closed

Add Scylla Sphinx Theme 1.0#815
dgarcia360 wants to merge 16 commits intoscylladb:masterfrom
dgarcia360:update-docs-theme-1.0

Conversation

@dgarcia360
Copy link
Copy Markdown
Contributor

Replaces #802

Sphinx ScyllaDB Theme 1.0 is now released 🥳

We’ve made a number of updates to the look and feel of the theme to improve the overall user experience.
You can read more about all notable changes here.

This PR also cleans the file conf.py, removing several unsued options.

How to test this PR

  1. Clone this PR. For more information, see Cloning pull requests locally.

  2. Enter the docs folder, and run:

make preview
  1. Open http://127.0.0.1:5500/ with your favorite browser. You will see the docs with the new look and feel:

image

lauranovich and others added 4 commits October 6, 2021 13:33
Upgrades the Scylla Theme to v1.x
This change does not include any HP fixes or any other issues which will be handled with additional PRs. Please merge this FIRST.
Upgrades the Scylla Theme to v1.x
This change does not include any HP fixes or any other issues which will be handled with additional PRs. Please merge this FIRST.
Update conf.py
@dgarcia360 dgarcia360 changed the title Update docs theme 1.0 Add Scylla Sphinx Theme 1.0 Oct 20, 2021
@dgarcia360
Copy link
Copy Markdown
Contributor Author

The new workflow that runs on PRs will raise an error. This should be fixed by #807

Copy link
Copy Markdown
Contributor

@tnozicka tnozicka 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 updating our theme, few comments on CI setup and bash machinery

Comment thread .github/workflows/[email protected]
@@ -0,0 +1,24 @@
name: "Docs / Build PR"
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

just Docs GH will automatically append (pull_request) to PR contexts

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

why not make just one definition with an optional last step to publish?

Copy link
Copy Markdown
Contributor Author

@dgarcia360 dgarcia360 Oct 26, 2021

Choose a reason for hiding this comment

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

The commands are different (make multiversion vs make test). Also, there are some repos that only need the "docs-pr", since the docs are published manually.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Shouldn't you build and test the code before running publishing? That would suggest the same job (with optional publishing step for some), not 2 of them run at different times on different revisions. The code in master may differ from what is tested in the PR.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Both workflows build and test the code, but in different ways:

  • docs-pr complains if there are errors and warnings for the latest build. In Sphinx, warnings are suggestions to improve the rst / md syntax, but they do not prevent the site from being rendered.

  • docs-pages builds and test the docs for all versions before publishing (only errors, not warnings). If there are errors, the build does not publish.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

if a job is required to pass on a PR, why shouldn't it be required to pass on master / after the merge?

Copy link
Copy Markdown
Contributor Author

@dgarcia360 dgarcia360 Dec 1, 2021

Choose a reason for hiding this comment

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

It could also run after the merge.

I've open this issue to run make tests on master branch after merge: scylladb/sphinx-scylladb-theme#254

- master
paths:
- "docs/**"
workflow_dispatch:
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

what's the use case here?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

workflow_dispatch allows you to trigger the workflow manually from the GitHub Actions panel. For more information, see GitHub Actions: Manual triggers with workflow_dispatch.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Thx, I know what it does. I am asking about the usecase for it when we are automatically publishing master into doc pages, so it should always match. Why do you need to trigger it manually?

Copy link
Copy Markdown
Contributor Author

@dgarcia360 dgarcia360 Oct 27, 2021

Choose a reason for hiding this comment

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

Imagine you have to backport a doc related change to a version branch / tag. The workflow won't know about the change until the master branch receives an update, or the repo maintainer triggers the workflow manually.

In this situations, we recommended to trigger the latest workflow again, but it would be best to trigger a new workflow with workflow_dispatch.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

ok, I think I see where the confusion is coming from. Conventionally, we pin all of our dependencies which means we always build the same output on re-trigger. I've noticed our docs don't, which is why it needs "workflow dispatch" hack. If we were to pin all the dependencies to make reproducible builds (and I think we should), you'd update by sending a PR and bumping that version without needing this artificial step, also make sure the dependency update passes CI. If deps can change randomly on us our CI can get borked at any time by an external change which is bad.

Copy link
Copy Markdown
Contributor Author

@dgarcia360 dgarcia360 Dec 1, 2021

Choose a reason for hiding this comment

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

It's not about updating the theme, but about modifying the docs (contents) from a previous branch / version.

- name: Build docs
run: make -C docs multiversion
- name: Deploy
run: ./docs/_utils/deploy.sh
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

set -x so CI logs contain the execution info

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Would this work?

Suggested change
run: ./docs/_utils/deploy.sh
run: |
set -x
make multiversion

I'd prefer to apply this change first to the workflow files all projects are sharing. We can add set -x with the next theme release 1.1.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

it's i different command this time but it's the structure I had in mind

Copy link
Copy Markdown
Contributor Author

@dgarcia360 dgarcia360 Oct 27, 2021

Choose a reason for hiding this comment

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

Could you please open an issue or a PR here with your proposal? https://github.com/scylladb/sphinx-scylladb-theme Other projects could benefit from this change as well. Thanks!

Comment thread docs/_utils/setup.sh
Comment thread docs/_utils/setup.sh Outdated
@tzach
Copy link
Copy Markdown
Contributor

tzach commented Nov 17, 2021

@dgarcia360 @tnozicka what is missing to merge this PR?
We want to move to the new theme

Comment thread .github/workflows/[email protected]
- master
paths:
- "docs/**"
workflow_dispatch:
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

ok, I think I see where the confusion is coming from. Conventionally, we pin all of our dependencies which means we always build the same output on re-trigger. I've noticed our docs don't, which is why it needs "workflow dispatch" hack. If we were to pin all the dependencies to make reproducible builds (and I think we should), you'd update by sending a PR and bumping that version without needing this artificial step, also make sure the dependency update passes CI. If deps can change randomly on us our CI can get borked at any time by an external change which is bad.

@@ -0,0 +1,24 @@
name: "Docs / Build PR"
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

if a job is required to pass on a PR, why shouldn't it be required to pass on master / after the merge?

Comment thread docs/pyproject.toml
pygments = "2.2.0"
recommonmark = "0.5.0"
sphinx-scylladb-theme = "~0.1.11"
sphinx-scylladb-theme = "~1.0.0"
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I think here (and everywhere else) we should pin with equality for the reasons mentioned above

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

"~" means update only if there is a new patch.

This allows us to release new theme versions with nonbreaking changes without having to submit a PR per repository.

If the major or minor is updated, the theme is not updated automatically.

More information: scylladb/sphinx-scylladb-theme#75

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I still believe we need to pin the dependencies but we could leave this and just add the poetry-lock file which solve this.

One of the goals of the CI run is reproducibility which would be negated by running with different dependency versions.

We needed to fix the python deps and while adding CI for it I had to pick most of the pieces from this PR in #886

@tnozicka
Copy link
Copy Markdown
Contributor

tnozicka commented Jan 5, 2022

Closing this in favor of #886 that has already landed.

@tnozicka tnozicka closed this Jan 5, 2022
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 this pull request may close these issues.

4 participants