-
-
Notifications
You must be signed in to change notification settings - Fork 3.6k
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
Build: expose VCS-related environment variables #10168
Changes from 14 commits
73d573d
d3f1bff
39c1fd3
58c49c3
04088d5
5fde482
5bb3d74
4687f09
3114f95
0ffc99a
8432ef5
420ba97
4b2eb75
6d4dd3b
77af82e
735d21b
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -56,6 +56,31 @@ All :doc:`build processes </builds>` have the following environment variables au | |
:Example: ``https://docs.readthedocs.io/ja/stable/`` | ||
:Example: ``https://example--17.org.readthedocs.build/fr/17/`` | ||
|
||
.. envvar:: READTHEDOCS_REPOSITORY_CLONE_URL | ||
|
||
URL for the remote source repository, from which the documentation is cloned. | ||
It could be HTTPS, SSH or any other URL scheme supported by Git. | ||
This is the same URL defined in your Project's :term:`dashboard` in :menuselection:`Admin --> Settings --> Repository URL`. | ||
|
||
:Example: ``https://github.com/readthedocs/readthedocs.org`` | ||
:Example: ``[email protected]:readthedocs/readthedocs.org.git`` | ||
|
||
.. envvar:: READTHEDOCS_REPOSITORY_IDENTIFIER | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Is this a repository id? Or a version ID? This is probably the name I'm the most unclear on whether it's correct. Again though, perfect naming is hard, and the examples tell most of the story. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I like
it's easier to understand. I think the old VCS semi-supported backends can just have to deal with that. If we want to really support something, we might as well re-introduce "VCS" or have stuff like There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yea, if we wanted it to be generic, we could use VCS, but I agree GIT is probably better, and forward looking 👍 There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. OK, I'm going to change the names to use |
||
|
||
Contains the Git identifier that was *checked out* from the remote repository URL. | ||
Possible values are either a branch or tag name. | ||
|
||
:Example: ``v1.x`` | ||
:Example: ``bugfix/docs-typo`` | ||
:Example: ``feature/signup`` | ||
:Example: ``update-readme`` | ||
|
||
.. envvar:: READTHEDOCS_REPOSITORY_IDENTIFIER_HASH | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I don't love how long this name is, but it seems reasonably explicit. I think IDENTIFIER and HASH are kind of the same thing, but I'm not sure if git has a canonical name for this. I couldn't quickly find it in the docs. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I added |
||
|
||
Git commit hash identifier checked out from the repository URL. | ||
humitos marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
||
:Example: ``1f94e04b7f596c309b7efab4e7630ed78e85a1f1`` | ||
|
||
.. seealso:: | ||
|
||
:doc:`/environment-variables` | ||
|
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.
Is there a reason we're calling it CLONE_URL, instead of REPOSITORY_URL to match the help_text?
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 because the repository will also have a "web URL", i.e. the base URL for where the file can be viewed and edited, so
ssh://[email protected]/repo
is different fromhttps://frontend.com/repo/
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.
Seems the doc is not correct then when it says it's the same as your Repository URL in the dashboard?
Users are definitely going to be confused if it's different, but only in some cases 🙃
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.
"Repository URL in the dashboard" is what we use as
Project.repo
, which is the same of the content of this variable. Do you have a suggestion how to make this clearer? I think having all these URLs is just confusing, but necessary, tho.I want to make the distinction between
HTML_URL
andCLONE_URL
mainly because they are not going to be always the same. In community, they will mostly be the same, tho.