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

refactor: start with random ticker message, fixes #5180 #5181

Merged
merged 2 commits into from
Jul 21, 2023

Conversation

gilbertsoft
Copy link
Member

@gilbertsoft gilbertsoft commented Jul 21, 2023

The Issue

On short living instances e.g. Gitpod the first ticker message is always show.

How This PR Solves The Issue

In case no message was shown so far, a random message is picked.

Manual Testing Instructions

Remove the state file ~/.ddev/.state.yaml and check if a random message is shown on ddev start.

Automated Testing Overview

Related Issue Link(s)

Release/Deployment Notes

@gilbertsoft gilbertsoft requested a review from a team as a code owner July 21, 2023 08:39
@github-actions
Copy link

Copy link
Member

@rfay rfay left a comment

Choose a reason for hiding this comment

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

If I delete ~/.ddev/.state.yaml and ddev start I get this:

$ ddev start
2023-07-21T11:02:16.319 Downloading remote config.
2023-07-21T11:02:16.732 Error while downloading remote config: invalid character ',' looking for beginning of value
panic: invalid argument to Intn

goroutine 1 [running]:
math/rand.(*Rand).Intn(0x140000dd878?, 0x1054db058?)
	/opt/homebrew/Cellar/go/1.20.5/libexec/src/math/rand/rand.go:179 +0x64
math/rand.Intn(...)
	/opt/homebrew/Cellar/go/1.20.5/libexec/src/math/rand/rand.go:358
github.com/ddev/ddev/pkg/config/remoteconfig.(*remoteConfig).ShowTicker(0x140004fe000)
	/Users/rfay/workspace/ddev/pkg/config/remoteconfig/messages.go:128 +0x70
github.com/ddev/ddev/cmd/ddev/cmd.glob..func57(0x105927080?, {0x10596e278, 0x0, 0x0})
	/Users/rfay/workspace/ddev/cmd/ddev/cmd/start.go:64 +0x284
github.com/spf13/cobra.(*Command).execute(0x105927080, {0x10596e278, 0x0, 0x0})
	/Users/rfay/workspace/ddev/vendor/github.com/spf13/cobra/command.go:944 +0x5b0
github.com/spf13/cobra.(*Command).ExecuteC(0x1059256a0)
	/Users/rfay/workspace/ddev/vendor/github.com/spf13/cobra/command.go:1068 +0x35c
github.com/spf13/cobra.(*Command).Execute(...)
	/Users/rfay/workspace/ddev/vendor/github.com/spf13/cobra/command.go:992
github.com/ddev/ddev/cmd/ddev/cmd.Execute()
	/Users/rfay/workspace/ddev/cmd/ddev/cmd/root.go:171 +0x28
main.main()
	/Users/rfay/workspace/ddev/cmd/ddev/main.go:28 +0xb8

I note that I'm also pointing to an invalid jsonc,

remote_config:
    remote:
        owner: rfay
        repo: remote-config
        ref: broken
        filepath: remote-config.jsonc

@rfay
Copy link
Member

rfay commented Jul 21, 2023

The panic should be solved by 6742995

Copy link
Member

@rfay rfay left a comment

Choose a reason for hiding this comment

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

This seems to be working fine now.

@rfay rfay changed the title refactor: start with random ticker message refactor: start with random ticker message, fixes #5180 Jul 21, 2023
@rfay rfay merged commit 0c01a52 into ddev:master Jul 21, 2023
22 of 24 checks passed
@rfay rfay deleted the refactor/random-message branch July 21, 2023 19:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants