Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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
Notify about outdated settings #23203
Notify about outdated settings #23203
Changes from 10 commits
d07784e
93bbad1
008f77d
aeb965d
c45ab0c
7f5503b
f3ddbd1
61e8af2
9f24391
b25df8b
78dc2d0
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
This file was deleted.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Wow, I don't think it's a good idea to ask maintainers to remember this.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In my mind, maybe:
git
to describe the base tag to get the working version?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you please elaborate on how I get the information on what our current version is?
If I know how to do it, I can implement it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
git describe
)git describe
:There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
From #26094
The version is currently set in
main
gitea/main.go
Line 28 in 6aa30af
gitea/Makefile
Line 108 in 6aa30af
To use it elsewhere you'll need to move it to a non-main package.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The problem is especially that it isn't in the main package, and my attempts to convert it to
modules.setting.history.currentGiteaVersion
were all fruitless endeavors thus far.That's why this PR has moved to the back of my TODO list as I haven't found out yet what to use.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
-X code.gitea.io/gitea/modules/setting/history.currentGiteaVersion=$(GITEA_VERSION)
should do the trick, although I'd recommend exporting the variable so we can use the same one in both places.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So these information will be displayed before setting.Init ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hmm,
init
seems uncontrollable. Is the logging system ready at the moment?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, that's one of the reasons it is in its own package. (The other is a clear separation of what belongs to what)
The package is only loaded when
PrintRemovedSettings
is called, which is exactly after the logging has been set up, and before any other processing has happened.If we decide to drop these two trace calls, it doesn't even matter for the
init
method if the other package has been loaded already or not, the log is then only needed forPrintRemovedSettings
.So, what is the preferred course of action here?
Dropping the
trace
calls, or keeping them in and relying on the logger being initialized?Or replacing the
init
with anInit
we call ourselves?No, it is called as soon as
setting.CfgProvider
has been set, but before any other settings have been initialized.Since there is no
setting.Init
(anymore?), that's the best course of action.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we should make the
Init
called explicitly, it makes the calling order controllable.