-
Notifications
You must be signed in to change notification settings - Fork 35
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
Move docs test workflow and rm obsolete docs processes #902
Conversation
93acd3b
to
65aebe3
Compare
This does: * Adds a docs test workflow in the ci.yml * Removes docs test from test.yml workflow (which tests the plugin) * Deprecate --docs feature from plugin-template * remove docs_test option * remove template/docs * remove template/bootstrap/docs legacy content * remove ci_update_docs * make it no-ops * Update various info across files Closes: pulp#901
65aebe3
to
65c470f
Compare
runs-on: "ubuntu-20.04" | ||
steps: | ||
- run: | | ||
echo "Skip docs testing on non-main branches." |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I tried moving the skip to the ci.yml and got some trouble with the final "ready-to-ship" checks.
I could update the logic there to allow skipping docs (I can, if that sounds better), but this approach feels simpler after all.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think I ran into the exact same issues before. Still anyone with a better idea...
# Gets set in .github/settings.yml, but doesn't seem to inherited by | ||
# this script. | ||
export DJANGO_SETTINGS_MODULE=pulpcore.app.settings | ||
export PULP_SETTINGS=$PWD/.ci/ansible/settings/settings.py | ||
|
||
export PULP_URL="{{ pulp_scheme }}://pulp" | ||
|
||
if [[ "$TEST" = "docs" ]]; then | ||
if [[ "$GITHUB_WORKFLOW" == "{{ plugin_app_label | camel | default("Pulp") }} CI" ]]; then | ||
towncrier build --yes --version 4.0.0.ci |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I wish we could keep this command somewhere.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The towncrier build
command?
On a first sight I just though it was not strictly related to the docs building process, but I can see we want to test if the PR contain valid assets for generating the changelogs.
I'll add a step in the new docs.yml
called Build changelog
, wdyt?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That sounds great. We should be using the generated changelog in the markdown build (or at least do a syntax check).
@@ -28,7 +28,10 @@ jobs: | |||
key: {{ "${{ runner.os }}-pip-${{ hashFiles('pulp-docs-main-sha') }}" }} | |||
restore-keys: | | |||
{{ "${{ runner.os }}-pip-" }} | |||
{{ install_python_deps(["-r", "doc_requirements.txt"]) | indent(6) }} | |||
{{ install_python_deps(["-r", "doc_requirements.txt", "towncrier"]) | indent(6) }} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm inclined to ask to just make it a doc_requirement...
@@ -1,5 +1,2 @@ | |||
{% include 'header.j2' %} | |||
-r requirements.txt | |||
towncrier |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ohh, It was one... ;)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, makes sense with having the changelog build step.
Will add towncrier
back to doc_requirements.
docs: | ||
uses: "./.github/workflows/docs.yml" | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We should keep this behind a flag, because a plugin outside of our control may want to do docs different.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How do you think we should determine the docs-managed repos?
- fetching from the existing config file in pulp-docs?
- declaring a list here?
- other?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh, I see your point. So the one point of authoritative information is the pulp-docs repository, yes?
Then we should take the information from there.
469d8c8
to
b9ec40e
Compare
{%- if plugin_name == 'pulpcore' %} | ||
if [[ "$TEST" = "publish" ]] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This sounds ridiculous. There is no "publish" test.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's safe to remove this, then?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I believe so. Maybe start with a "git grep publish". But I'm pretty sure this is a leftover from former versions of the release process.
pulp config create --base-url {{ pulp_scheme }}://pulp{% if pulp_scheme != 'https' %} --no-verify-ssl{% endif %} --api-root "$PULP_API_ROOT" --username "admin" --password "password" | ||
{% if test_cli -%} | ||
if [[ "$TEST" != "docs" ]]; then | ||
cp ~/.config/pulp/cli.toml "${REPO_ROOT}/../{{ cli_package }}/tests/cli.toml" | ||
fi | ||
cp ~/.config/pulp/cli.toml "${REPO_ROOT}/../{{ cli_package }}/tests/cli.toml" | ||
{%- endif %} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you move that whole block up to around line 30 to have the cli stuff in one place?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Didn't seem to work. Don't try this again just now.
requirements.txt
Outdated
@@ -1,2 +1,3 @@ | |||
tomlkit~=0.12.4 | |||
pypandoc_binary~=1.13 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
looks like this can be dropped again.
86eb27e
to
14d4ee7
Compare
{% if test_cli -%} | ||
cp ~/.config/pulp/cli.toml "${REPO_ROOT}/../{{ cli_package }}/tests/cli.toml" | ||
PULP_CLI_VERSION="$(pip freeze | sed -n -e 's/{{ cli_package }}==//p')" | ||
git clone --depth 1 --branch "$PULP_CLI_VERSION" {{ cli_repo }} ../{{ cli_package }} | ||
{%- endif %} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hmm, I've just reviewed that move, around line 138 we have:
{%- if test_reroute %}
export PULP_API_ROOT="/rerouted/djnd/"
{%- endif %}
So I guess it really should be down there, so it can use the proper value of PULP_API_ROOT.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hmm. that explains why we do it down there.
Let's not do this now then. But we should think about a more structured approach to set all this up in a later PR.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reverted
Co-authored-by: Matthias Dellweg <[email protected]> [noissue]
14d4ee7
to
a3e92bc
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is a huge change. And maybe we can iterate to improve on it. But not necessarily in this PR.
Things to follow up on:
- A more structured approach to define pulp settings, configure the cli, start the containers, ...
- Are there we should mark as deprecated from the old docs templates? Is CI now the right place to delete them?
runs-on: "ubuntu-20.04" | ||
steps: | ||
- run: | | ||
echo "Skip docs testing on non-main branches." |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think I ran into the exact same issues before. Still anyone with a better idea...
{%- if plugin_name == 'pulpcore' %} | ||
if [[ "$TEST" = "publish" ]] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I believe so. Maybe start with a "git grep publish". But I'm pretty sure this is a leftover from former versions of the release process.
pulp config create --base-url {{ pulp_scheme }}://pulp{% if pulp_scheme != 'https' %} --no-verify-ssl{% endif %} --api-root "$PULP_API_ROOT" --username "admin" --password "password" | ||
{% if test_cli -%} | ||
if [[ "$TEST" != "docs" ]]; then | ||
cp ~/.config/pulp/cli.toml "${REPO_ROOT}/../{{ cli_package }}/tests/cli.toml" | ||
fi | ||
cp ~/.config/pulp/cli.toml "${REPO_ROOT}/../{{ cli_package }}/tests/cli.toml" | ||
{%- endif %} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Didn't seem to work. Don't try this again just now.
) | ||
document = header + document | ||
return document | ||
return [line.strip()[8:] for line in response.content.decode().split("\n") if "- name:" in line] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is a rather crude way to parse yaml...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
My plan is to do the minimum working solution now and later improve this membership thing (on pulp-docs, also). But I can add a yml library as requirement and make it more robust. Would you prefer that?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Will it stay parsing yaml? Or did you plan something completely different?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I thought about doing a simple requirement-like file which lists gh-org/gh-repo
and has #
comments, but not sure if it's a good idea yet. If not, I might stick with yaml.
@@ -328,26 +327,25 @@ def main(): | |||
except Exception: | |||
config["current_version"] = "0.1.0a1.dev" | |||
|
|||
# Determine if plugin is a member of Pulp managed documentation | |||
config["is_pulpdocs_member"] = config["plugin_name"] in utils.get_pulpdocs_members() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I like it. When onboarding a new plugin to the docs, we need to be extra careful. (Just a reminder at this point.)
Let's merge and continue from there. |
This does:
Closes: #901
Testing
This does not cover all workflows, only CI