Skip to content

Fails to fetch tags when initializing the repository for ReadtheDocs build #10923

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

Closed
Qizhen-Xue opened this issue Nov 24, 2023 · 4 comments
Closed

Comments

@Qizhen-Xue
Copy link

Details

Expected Result

Our project is using Tags to manage the release version. Previously before ReadtheDocs version update, the default git command will clone the whole repository and then checkout to the corresponding commit. At that time it all works fine.
After the recent ReadtheDocs update, we expect that the repository could fetch the corresponding tag with the default git command.

Actual Result

The fetch fails due to git fetch command error.
readthedocs_fetch_error

Suggested feature or behaviour

In my point of view, the fetch command should be git fetch origin --force --prune --prune-tags --depth 50 refs/tags/v1.37.0:refs/remotes/origin/v1.37.0. refs/heads should be replaced by refs/tags.

I also noticed that the git commands are changed in #10430. Actually it does have an option to fetch tags, where is

return f"refs/tags/{tag_name}:refs/tags/{tag_name}"

However, I could not find a way to define version_type and verbose_name by myself. I also tried to set the environment variable to READTHEDOCS_VERSION_TYPE to be tag. But it's not allowed to set such an variable start with READTHEDOCS.

@humitos , sorry it might bother your work. But do you have any opinion that I could set my build job's version_type to be tag? Or if you have any other solution for this issue, please kindly give me some suggestion. I'm not sure if this problem is a bug or not. If so, I believe there should be many other projects would meet the same error. I've seen #10915, but it's not quite the same situation as it's not using tags to manage the release version. Now our release process is just in progress and blocked by this document build failure. Thanks for any help!

@stsewd
Copy link
Member

stsewd commented Nov 27, 2023

Hi, this case should already be supported with #10738. Looks like your project hasn't triggered a build in a while, so it hasn't caught up with that change.

In order to fix this, you'll need to re-sync your versions, this is done automatically after clone, but since your project fails in that step, the sync never happens. I have manually triggered a sync for your project, you should be able to use the new tag now.

For users hitting this, you can solve it by triggering a build of an existing version (this will re-sync your versions to use the proper version type for latest). After that you should be able to trigger a build for latest. I'll see if we can detect all projects hitting this to trigger a re-sync for those.

@stsewd stsewd closed this as completed Nov 27, 2023
@Qizhen-Xue
Copy link
Author

Qizhen-Xue commented Nov 28, 2023

@stsewd Thanks a lot! It does work now for nnabla project. But I'm sorry that I missed another project, which is https://readthedocs.org/projects/nnabla-nas/. The failed build is https://readthedocs.org/projects/nnabla-nas/builds/22677816/. It's now facing the same problem. Could you please manually triggered a sync for this project again? Thank you so much!

@stsewd
Copy link
Member

stsewd commented Nov 28, 2023

@Qizhen-Xue you can solve this by triggering a build on an existing version, but looks like you already did that

Screenshot 2023-11-28 at 10-09-27 Builds Read the Docs

Your problem should be solved

@Qizhen-Xue
Copy link
Author

Qizhen-Xue commented Nov 29, 2023

@Qizhen-Xue you can solve this by triggering a build on an existing version, but looks like you already did that

Screenshot 2023-11-28 at 10-09-27 Builds Read the Docs

Your problem should be solved

Thank you for your information again! I do expect this trigger could solve my problem but it didn't work at the beginning. Now after further investigation, I found that it will only works after I trigger a build with both default version and default branch to be v0.15.0. Only default version v0.15.0 and keep the default branch to be empty could not solve the problem. Moreover, once it successfully switch to refs/tags, I could only set latest branch points to a tag but no more branch such as master.

So currently this project has no problem and don't need a manual trigger anymore. But I think the mechanism is kinda obscure for the user.

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

No branches or pull requests

2 participants