Skip to content

Conversation

@humitos
Copy link
Member

@humitos humitos commented Aug 15, 2025

Initial POC to support this feature. It will allow us to support customers with specific needs. We don't plan to expose this directly to users yet, since there are some internals that need to be met to work:

  • Use specific environment variables
  • Clone the repository in . to keep with the default workflow
  • Depending on the repository structure, a custom YAML path and custom python.install.requirements may be needed as well (I added this commit humitos/rocm-libraries@a393812)

All of this can be documented eventually, but we need an internal way to write these custom commands to onboard customers with these needs.

Screenshot_2025-08-15_12-06-48

The value for Project.git_checkout_command is:

[
    "env",
    "echo $READTHEDOCS_GIT_CLONE_URL",
    "git clone --no-checkout --no-tag --filter=blob:none --depth 1 $READTHEDOCS_GIT_CLONE_URL .",
    "git sparse-checkout init --cone",
    "git sparse-checkout set projects/rocblas",
    "git checkout $READTHEDOCS_GIT_IDENTIFIER"
]

Closes #12313

Initial POC to support this feature. It will allow us to support customers with
specific needs. We don't plan to expose this directly to users yet, since there
are some internals that need to be met to work:

- Use specific environment variables
- Clone the repository in `.` to keep with the default workflow
- Depending on the repository structure, a custom YAML path and custom
  `python.install.requirements` may be needed as well.

All of this can be documented eventually, but we need an internal way to write
these custom commands to onboard customers with these needs.

Closes #12313
@humitos
Copy link
Member Author

humitos commented Aug 16, 2025

There is a lot of tests failing due to

  File "/home/circleci/project/.tox/py312/lib/python3.12/site-packages/django_gravatar/helpers.py", line 36, in calculate_gravatar_hash
    enc_email = email.strip().lower().encode("utf-8")
                ^^^^^^^^^^^
AttributeError: 'NoneType' object has no attribute 'strip'

doesn't seem related to my code 🤷🏼

@humitos
Copy link
Member Author

humitos commented Aug 16, 2025

doesn't seem related to my code 🤷🏼

Ah, yeah, they are failing in main as well...

Copy link
Contributor

@agjohnson agjohnson left a comment

Choose a reason for hiding this comment

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

This seems minor enough. I think we could make this feature fit into the build jobs feature flow better though, but this is okay for an initial test.

"readthedocs_yaml_path",
"clone_token",
"has_ssh_key_with_write_access",
"git_checkout_command",
Copy link
Contributor

Choose a reason for hiding this comment

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

I think we can also frame this as build.jobs.checkout override, so this doesn't need to be another feature this is at odds with the build jobs concept. I originally thought we'd implement this as a project database configuration file, so that projects with old tags/etc might even be able to benefit.

We can always migrate to this pattern later though.

Copy link
Member Author

Choose a reason for hiding this comment

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

Yeah, in the linked issue we talked about adding this field as first option; that's why I went this way.

Note that adding this feature as a build.jobs.checkout is a larger project that involves adding a new config key, validation, etc but also the build director needs to be modified more in deep. I don't think we need that for now since it's only one customer that requested this and we will be managing it by support request.

As you mentioned, we can migrate to the more generic build.jobs concept in the future if we consider it a good feature and more requested by customers.

@humitos humitos merged commit 4286c03 into main Aug 19, 2025
3 of 4 checks passed
@humitos humitos deleted the humitos/custom-git-checkout-step branch August 19, 2025 08:29
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.

Config: allow customization of project pre_checkout and checkout step

3 participants