Skip to content

Warn users if anything is written to old artifact directory #10036

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
ericholscher opened this issue Feb 15, 2023 · 7 comments · Fixed by #10126
Closed

Warn users if anything is written to old artifact directory #10036

ericholscher opened this issue Feb 15, 2023 · 7 comments · Fixed by #10126
Assignees

Comments

@ericholscher
Copy link
Member

I think we've come across a few edge cases where the build output path changes have introduced bugs. We can probably expect more or perhaps a few fixes here.

Add warning if the old artifact path still exists, or a shim to copy that in with a warning for now.

This one will be partially solved by documentation too, though I'm guessing we probably want some error catching here, if a third party tool writes to _build/html etc.

@ericholscher ericholscher converted this from a draft issue Feb 15, 2023
@ericholscher ericholscher changed the title Placeholder: build output path issues Warn users if anything is written to old artifact directory Feb 15, 2023
@humitos
Copy link
Member

humitos commented Feb 16, 2023

@agjohnson do you have an idea about how to show this warning?

Currently, we don't support showing a warning message from the build. We only support showing an error. I'd say that probably the first step here is to log.info those projects that are outputting this into _build/html and see how many are those. Then, decide what to do and how.

@humitos
Copy link
Member

humitos commented Feb 16, 2023

@agjohnson also, do you have an example of a project outputting to _build/html?

humitos added a commit that referenced this issue Feb 16, 2023
We have changed the output directory from `_build/html` to
`$READTHEDOCS_OUTPUT/html` in the last few weeks.

However, there are some projects that may have `_build/html` directory hardcoded
in different places (e.g. `conf.py`). We want to log these projects and contact
them to communicate this situation.

Ideally, we should show a warning in the build detail's page, but I don't think
we currently have a way to display a warning message. We only support error
messages in this page.

Related #10036
@humitos humitos moved this from Planned to Needs review in 📍Roadmap Feb 16, 2023
@agjohnson
Copy link
Contributor

agjohnson commented Feb 16, 2023

do you have an idea about how to show this warning?

We probably want an error, not a warning. Projects that are using a hardcoded path end up with docs missing lots of content right now. This is silent, and only noticeable if you open up your documentation and notice the missing content.

A warning is only a small upgrade here, as it is still silent, and still requires the user to open up their documentation to find the missing content.

So, a hard error makes the most sense here. I'd prefer setting Build.error for now, but would like to continue pushing towards better tip/warning/error messages.

@agjohnson
Copy link
Contributor

agjohnson commented Feb 16, 2023

also, do you have an example of a project outputting to _build/html?

I'd have to dig up the conversations in support, but anyone using Doxygen might be hitting this right now. Doxygen (and I assume Breathe?) seem to use a hardcoded path to output API docs.

@humitos
Copy link
Member

humitos commented Feb 16, 2023

We probably want an error, not a warning

OK. I will do that then. Makes sense 👍🏼

@humitos humitos moved this from Needs review to In progress in 📍Roadmap Feb 20, 2023
humitos added a commit that referenced this issue Feb 23, 2023
* Build: log usage of old output directory `_build/html`

We have changed the output directory from `_build/html` to
`$READTHEDOCS_OUTPUT/html` in the last few weeks.

However, there are some projects that may have `_build/html` directory hardcoded
in different places (e.g. `conf.py`). We want to log these projects and contact
them to communicate this situation.

Ideally, we should show a warning in the build detail's page, but I don't think
we currently have a way to display a warning message. We only support error
messages in this page.

Related #10036

* Build: use "test" command

* Lint
@agjohnson
Copy link
Contributor

agjohnson commented Feb 28, 2023

With the logging changes through this morning, I think the volume of these errors is reasonable enough to fail any build outputting to _build/html. So far, I only see two hits from commercial, none from community yet.

Volume is low enough that I'm not worried about hotfixing this immediately, but if it ends up being a bit higher, we should consider that. Either way, we should target next release for a fix.

@humitos
Copy link
Member

humitos commented Feb 28, 2023

It seems there is only one project in commercial so far: https://onenr.io/0OQMEqG19QG

@humitos humitos moved this from In progress to Needs review in 📍Roadmap Mar 8, 2023
humitos added a commit that referenced this issue Mar 8, 2023
humitos added a commit that referenced this issue Mar 9, 2023
* Build: check for `_build/html` directory and fail if exists

Continuation of #10038
Closes #10036

* Update exception message

Co-authored-by: Anthony <[email protected]>

---------

Co-authored-by: Anthony <[email protected]>
@github-project-automation github-project-automation bot moved this from Needs review to Done in 📍Roadmap Mar 9, 2023
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 a pull request may close this issue.

3 participants