-
-
Notifications
You must be signed in to change notification settings - Fork 583
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
Set default values for each property of versions
object
#3268
Conversation
- set Docker versions (local/remote) to `null` if they are empty strings, undefined or null; - set other components versions to `"N/A"` if they are empty strings, undefined or null; - set branches and hashes to `null` if they are empty strings, undefined or null; Signed-off-by: RD WebDesign <[email protected]>
This should be done in the API and the code here should be rewritten to not needing the immediate |
It's another possibility. |
Do you want to solve the issue in FTL or should I mark this PR as "ready for review"? |
I already did this somewhere these days but seemingly forgot to push the branch. Will have a look for it after work. |
Is this really needed? Looking into the FTL source code, this exact usecase seems to be already there. Okay, no I guess what is really needed here is a small fix of the
This will effectively avoid an empty string being returned by the API and, hence, the automatic substitution with the |
Even with pi-hole/FTL#2335 we need some small tweak to avoid the empty component to disappear |
With the new FTL branch, only the EDIT: If Using the new FTL branch, the API is sending: "web":{
"local":{
"branch":null,
"version":null,
"hash":null
},
"remote":{
"version":null,
"hash":"54e5b294"
}
}, We can avoid this web PR is FTL sends something like this: "web":{
"local":{
"branch":null,
"version":"N/A",
"hash":null
},
"remote":{
"version":"N/A",
"hash":"54e5b294"
}
}, |
Signed-off-by: RD WebDesign <[email protected]>
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 am going back and forth about this but I think it's more natural (as in: computer-friendly) for the API to consistently reply with |
What does this PR aim to accomplish?
Fixes issues when
versions
file contains empty or null versions, to avoid an empty footer or invalid version descriptions.If
local.version
isnull
, the old code completely hides the component version.See:
How does this PR accomplish the above?
EDIT:
Now FTL will never send an empty string. If FTL can't find a valid string it will send
null
.If
local.version
isnull
, the footer code will convert it to "N/A", to avoid empty footer or invalid versions.By submitting this pull request, I confirm the following:
git rebase
)