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

Do not overwrite the log mode when installing (#25203) #25209

Merged
merged 2 commits into from Jun 13, 2023

Conversation

GiteaBot
Copy link
Contributor

Backport #25203 by @wxiaoguang

Fix #24861

@GiteaBot GiteaBot added type/bug topic/deployment lgtm/need 2 This PR needs two approvals by maintainers to be considered for merging. labels Jun 12, 2023
@GiteaBot GiteaBot added this to the 1.20.0 milestone Jun 12, 2023
@pull-request-size pull-request-size bot added the size/XS Denotes a PR that changes 0-9 lines, ignoring generated files. label Jun 12, 2023
@GiteaBot GiteaBot requested review from delvh and lunny June 12, 2023 10:53
@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 Jun 12, 2023
@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 Jun 12, 2023
@@ -453,10 +453,9 @@ func SubmitInstall(ctx *context.Context) {

cfg.Section("session").Key("PROVIDER").SetValue("file")

cfg.Section("log").Key("MODE").SetValue("console")
cfg.Section("log").Key("MODE").MustString("console")
cfg.Section("log").Key("LEVEL").SetValue(setting.Log.Level.String())
cfg.Section("log").Key("ROOT_PATH").SetValue(form.LogRootPath)
Copy link
Member

Choose a reason for hiding this comment

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

By the way, shouldn't all these other keys be MustString either?
It seems a bit strange that only the log isn't overwritten?`

Copy link
Contributor

Choose a reason for hiding this comment

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

Nope.

setting.Log.Level is from the config, so no overwritten

form.LogRootPath is from user input (by default is also from the config)

  • if user ever changed it, then it must overwrite
  • if user didn't change it, still no overwritten

Copy link
Member

Choose a reason for hiding this comment

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

Well, if we simply go by values that are explicitly set here, those are still [session].PROVIDER, [repository.pull-request].DEFAULT_MERGE_STYLE, and [repository.signing].DEFAULT_TRUST_MODEL

Copy link
Contributor

Choose a reason for hiding this comment

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

Yes, there are still many legacy problems. I have searched these "SetValue" while I think we do not need to change too much at the moment.

Leave the problem to after the INI package refactoring.

And, end users could always prepare a full app.ini with "INSTALL_LOCK=true", then no overwriting problem anymore.

Copy link
Member

Choose a reason for hiding this comment

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

How about to prevent user installing again from UI?

Copy link
Contributor

Choose a reason for hiding this comment

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

  1. I have done so
  2. Some users are doing fresh installation, the "app.ini" comes from docker environment variables, they do not "install again".

Copy link
Member

Choose a reason for hiding this comment

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

I guess a backport is not the right place to discuss 😆

@delvh delvh added the reviewed/wait-merge This pull request is part of the merge queue. It will be merged soon. label Jun 13, 2023
@silverwind silverwind merged commit fa28d0e into go-gitea:release/v1.20 Jun 13, 2023
21 checks passed
@GiteaBot GiteaBot removed the reviewed/wait-merge This pull request is part of the merge queue. It will be merged soon. label Jun 13, 2023
@go-gitea go-gitea locked as resolved and limited conversation to collaborators Sep 12, 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/XS Denotes a PR that changes 0-9 lines, ignoring generated files. topic/deployment type/bug
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants