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

Docs: build.jobs reference documentation #9056

Merged
merged 1 commit into from
Apr 4, 2022

Conversation

humitos
Copy link
Member

@humitos humitos commented Mar 30, 2022

Small reference documentation for build.jobs and all the pre/post jobs allowed.

Related #9016

Small reference documentation for `build.jobs` and all the pre/post jobs allowed.
@humitos humitos force-pushed the humitos/build-jobs-reference-docs branch from 7b9aa52 to 22192c8 Compare March 31, 2022 15:28
@humitos humitos enabled auto-merge March 31, 2022 15:28
@humitos humitos disabled auto-merge March 31, 2022 15:28
docs/user/config-file/v2.rst Outdated Show resolved Hide resolved
Comment on lines +425 to +426
Commands to be run before or after a Read the Docs pre-defined job.
This allows you to run custom commands at a particular moment in the build process.
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
Commands to be run before or after a Read the Docs pre-defined job.
This allows you to run custom commands at a particular moment in the build process.
Commands to be run before or after a Read the Docs pre-defined build step.
This allows you to run custom commands at various times in the build process.
A few common use cases for this area:
* Modifying the state of the checkout of your repository
* Stopping a build by returning a non-zero exit code on certain conditions
* Running a command to process generate markup files prior to building

Thinking more about this, we probably need to define this feature a lot more explicitly in the docs somewhere, particularly around exit codes.

Copy link
Member Author

Choose a reason for hiding this comment

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

I didn't mention use cases here because none of the other config keys do that. Instead, I suggested writing a guide explaining what are the known use cases we have already and expanding on each of them clearly.

I see this page as reference documentation that only explains what are the possible/valid config keys and values of each of them, but it does not talk about use cases. I'd include the link to that guide page here once we write it, tho, as we do with build.tools.python and the Conda Support link (https://docs.readthedocs.io/en/stable/config-file/v2.html#build-tools-python)

What do you think?

version: 2

build:
os: ubuntu-22.04
Copy link
Member

Choose a reason for hiding this comment

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

Should we make this a string for consistency?

Suggested change
os: ubuntu-22.04
os: "ubuntu-22.04"

Copy link
Member Author

Choose a reason for hiding this comment

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

This one, in particular, is not required to be a string. However, we can declare it as it. We should change the other one as well where I copied it from https://docs.readthedocs.io/en/stable/config-file/v2.html#build


.. note::

Each key under ``build.jobs`` must be a list of strings.
Copy link
Member

Choose a reason for hiding this comment

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

I don't really know what this means. Can we communicate it more explicitly somehow? What else would users try to do here, that might be wrong?

Copy link
Member Author

Choose a reason for hiding this comment

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

I'm trying to avoid users writing something like

build:
  jobs:
    post_install: pip install mypackage

when it should be

build:
  jobs:
    post_install: 
      - pip install mypackage

Each key under ``build.jobs`` must be a list of strings.


:Type: ``dict``
Copy link
Member

Choose a reason for hiding this comment

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

Seems like the above note is probably better noted here?

@humitos
Copy link
Member Author

humitos commented Apr 4, 2022

I'm merging this so it goes out tomorrow together with the deploy and the build.jobs feature. We can come back to this comment later #9056 (comment) and also continue the discussion about how the documentation should be written in #9067

@humitos humitos merged commit 8eadc9c into main Apr 4, 2022
@humitos humitos deleted the humitos/build-jobs-reference-docs branch April 4, 2022 09:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

3 participants