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

Add gitea manager reload-templates command #24843

Merged
merged 11 commits into from
May 22, 2023

Conversation

brechtvl
Copy link
Contributor

This can be useful to update custom templates in production mode, when they are updated frequently and a full Gitea restart each time is disruptive.

This can be useful to update custom templates in production mode, when they
are updated frequently and a full gitea restart each time is disruptive.
@GiteaBot GiteaBot added the lgtm/need 2 This PR needs two approvals by maintainers to be considered for merging. label May 21, 2023
@pull-request-size pull-request-size bot added the size/M Denotes a PR that changes 30-99 lines, ignoring generated files. label May 21, 2023
@brechtvl
Copy link
Contributor Author

This might be a bit obscure, I'm not sure how generally useful this functionality is. But our templates display things like release status and ongoing projects, and it's nice to be able to update those without risking e.g. data loss when submitting comments or failed git repository access to update those.

@lunny
Copy link
Member

lunny commented May 22, 2023

Maybe we also need a template load test sub command to do a test before real reload.

@GiteaBot GiteaBot added lgtm/need 1 This PR needs approval from one additional maintainer to be merged. and removed lgtm/need 2 This PR needs two approvals by maintainers to be considered for merging. labels May 22, 2023
@wxiaoguang
Copy link
Contributor

wxiaoguang commented May 22, 2023

Maybe we also need a template load test sub command to do a test before real reload.

I see the original PR doesn't have so, and I do not think there is a real case which really requires "testing". If there is any error, the old templates are still used.

Do you think this is a must? If no, I would suggest to keep things simple (no test). @lunny

@lunny
Copy link
Member

lunny commented May 22, 2023

Maybe we also need a template load test sub command to do a test before real reload.

I see the original PR doesn't have so, and I do not think there is a real case which really requires "testing". If there is any error, the old templates are still used.

Do you think this is a must? If no, I would suggest to keep things simple (no test). @lunny

If the reload failure will not break the old templates I agree we don't need the test.

@brechtvl
Copy link
Contributor Author

I removed the --test flag now. When there is an error on reload, the old templates are kept. It was already implemented to work this way for auto reloading in dev mode.

@GiteaBot GiteaBot added lgtm/done This PR has enough approvals to get merged. There are no important open reservations anymore. and removed lgtm/need 1 This PR needs approval from one additional maintainer to be merged. labels May 22, 2023
@lunny lunny added the reviewed/wait-merge This pull request is part of the merge queue. It will be merged soon. label May 22, 2023
@lunny lunny merged commit 3588edb into go-gitea:main May 22, 2023
@GiteaBot GiteaBot added this to the 1.20.0 milestone May 22, 2023
@GiteaBot GiteaBot removed the reviewed/wait-merge This pull request is part of the merge queue. It will be merged soon. label May 22, 2023
zjjhot added a commit to zjjhot/gitea that referenced this pull request May 23, 2023
* upstream/main:
  Fix install page context, make the install page tests really test (go-gitea#24858)
  Add validations.required check to dropdown field (go-gitea#24849)
  Use Go 1.20 for next release (go-gitea#24859)
  Add gitea manager reload-templates command (go-gitea#24843)
  Remove `In your repositories` link in milestones dashboard (go-gitea#24853)
  Fix 500 error when select `No assignee` filter in issue list page (go-gitea#24854)
  Add IsErrRepoFilesAlreadyExist check when fork repo (go-gitea#24678)
  Fix missing yes/no in delete time log modal (go-gitea#24851)
  Fix document and improve comment (go-gitea#24844)

# Conflicts:
#	web_src/css/base.css
@go-gitea go-gitea locked as resolved and limited conversation to collaborators Aug 20, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
lgtm/done This PR has enough approvals to get merged. There are no important open reservations anymore. size/M Denotes a PR that changes 30-99 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants