-
-
Notifications
You must be signed in to change notification settings - Fork 585
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
Feature showing messages to the users, fixes #3799 #4885
Conversation
Download the artifacts for this pull request:
See Testing a PR |
be5a781
to
8346344
Compare
8346344
to
43ebb2b
Compare
It would be cool to be able to show a variety of messages, so people don't get bored. Instructional, etc. |
Nice idea. Like Docker Desktop does it on startup. Will think about... |
3c6640f
to
d1f8c9e
Compare
Done |
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.
Taking a first casual look through. I don't understand it all yet, but made some suggestions about naming, etc. It's a lot of code for a small feature of course.
I see lots and lots of unexpected stuff being loaded into vendor, like github.com/ProtonMail (go-crypto I guess, but pulls in lots more, why that and also x/crypto?)? github.com/cloudflare (circl I guess, but what for?)? and of course the duplicated go-github/v52
Currently, every ddev start
repeats the same message, "Ensure maintenance and further development of DDEV see..." We don't want to repeat the same message all the time, and don't want to show a message on every command. Maybe once a day?
It does seem to rotate on some of the other messages, but I don't think we want to show any message on most commands. Just daily or whatever?
But it's currently just on start, is that true?
pkg/manifest/manifest.go
Outdated
m.Manifest, err = m.githubStorage.Pull() | ||
|
||
if err != nil { | ||
util.Error("Error while downloading manifest: %s", err) |
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'm not sure we should be notifying the user about problems like 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.
Yes, is currently mainly for testing purposes, Debug would be fine here too!
data fileStorageData | ||
} | ||
|
||
// fileStorageData is the structure used for the file. |
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.
If making a comment, at least give enough info to make it useful. Say what file, etc. Was this generated by Github Copilot?
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.
A lot of comments will follow.... Also I like to have a description in each package what it is meant for.
I've installed the latest version of go-github (v52) which is breaking and so far did not update the existing usages e.g. for
There are two features like mentioned in the docs: infos and warnings, which will show on every start, and the tips, which will rotate.
At the moment the messages are shown on The idea of infos and warnings is to have the posibility to show important messages to the user. This could make sense to be shown on most commands and on every call. E.g. if an update of an old version is important because of a security risk. The tips is someting we also could implement to be shown once a day only, sounds good to me. An ofc the messages should be printed in a nicer way, just did a simple output so far! |
Requests from our meeting today:
|
This belongs to #4866 |
@rfay what about |
376da2b
to
08429e1
Compare
"remoteconfig" sounds OK to me. I just realized that the time interval between showing messages should/could be specified in the manifest.json/remoteconfig.json (preferably remoteconfig.jsonc if we have a way to successfully read jsonc). Then we'd be able to introduce more important warnings, etc. |
f0be104
to
eae3d1b
Compare
0ffb0f6
to
558c9f5
Compare
a1ee990
to
9b016b7
Compare
Rebased. Is this ready for review? |
1a354e4
to
023bcab
Compare
I haven't yet been able to make this work or get any kind of notification. We should do a screenshare to look at it tomorrow. However, when it does work, it should absolutely not be creating any output except on |
Do you mind if I push this into the PR?
|
Per discussion in remote-images, let's go ahead and detect terminal width and wrap. I actually think the table code has this built in, and it will work fine for single-column stuff like this. |
(Working on wrapping right now) |
I think the remote config isn't created if it doesn't exist and the .state.yaml says that it might have been updated. I doubt this much matters. But it breaks testing. |
I'm pretty sure these notes would be more effective at the beginning of |
I took the liberty to push a wrapping change in in e6bb8bf, we can revert if you don't like it. But here's what it looks like: |
Looks good, thanks! |
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.
Minor change requests, this seems to be working great. It's a really heavy load for what we expected, but I know you have great hopes for some of the things you added. Maybe we'll be able to use them where they can be used.
I tested with various terminal window sizes, and tested with internet disabled, and all seems to go well.
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.
Thanks for all the hard work on this, let's get it in. Please pull it when you're ready. Don't worry about the wsl failure, I'm sure it would clear, not related to this anyway.
Yes, had to restart the WSL test system, was completely broken. |
The Issue
We like to show messages to the user e.g. a hint to support DDEV with sponsoring the project.
How This PR Solves The Issue
This patch introduces an easy way to provide infos, warnings and rotating ticker messages in the remote-config repository which will be regulary downloaded and shown to the user.
Open tasks:
Manual Testing Instructions
To test this feature run a ddev command e.g.
ddev describe
, messages should be shown. Manipulate or delete the state file~/.ddev/.state.yaml
to get faster results. It's also possible to change the interval of the ticker in the~/.ddev/global_config.yaml
or switch to the testing branch of the remote-config, description to do so can be found in the config file.Automated Testing Overview
Related Issue Link(s)
Release/Deployment Notes