Skip to content
This repository has been archived by the owner on Jan 8, 2024. It is now read-only.

feature: Queue status reports on continuous interval for applications #1801

Merged
merged 65 commits into from
Jul 28, 2021

Conversation

briancain
Copy link
Member

@briancain briancain commented Jul 7, 2021

This pull request introduces a queued poll handler for applications which queues a status report job every 5 minutes by default after the initial deployment or release of an application. It includes a peek and complete function for applications that behaves similar to ProjectPeek and ProjectComplete. It includes its own index table to keep track of the applications poll times and intervals. Initially, each projects applications poll handler is turned off until a user does a deployment or release. This saves us cycles in the server where there are no applications to generate a status for. The status report operation is in charge of updating the apps poll status once a status report has been initially generated.

This feature also allows users to turn off the application poll queuer or adjust the interval, given that it's likely with enough applications users could run into rate limits on their accounts for platforms such as AWS.

Fixes #1612

Note: Currently this will only poll if the project is backed by a remote data source with git.

@github-actions github-actions bot added the core label Jul 7, 2021
@briancain briancain requested a review from a team July 7, 2021 21:09
internal/server/singleprocess/poll_test.go Show resolved Hide resolved
internal/server/singleprocess/service_job.go Outdated Show resolved Hide resolved
internal/server/singleprocess/state/application_test.go Outdated Show resolved Hide resolved
internal/server/singleprocess/state/project.go Outdated Show resolved Hide resolved
@briancain briancain force-pushed the feat/app-poll-handler branch 2 times, most recently from a9ef3f2 to e5a3ee4 Compare July 19, 2021 20:37
@briancain briancain marked this pull request as ready for review July 19, 2021 20:53
Auto-enable polling if a project has a data source that is backed by git
and has polling enabled. This changes the previous behavior of app
status polling being enabled after the _first_ status report was
generated
If we're polling and a deployment gets deleted for an app, rather than
returning an error and failing the entire poll queue handler, just log a
warning so other apps can be queued against
internal/server/singleprocess/poll_application.go Outdated Show resolved Hide resolved
@@ -119,7 +119,7 @@ func (s *service) queueJobReqToJob(
project, err := s.state.ProjectGet(&pb.Ref_Project{Project: job.Application.Project})
if status.Code(err) == codes.NotFound {
return nil, status.Errorf(codes.NotFound,
"Project %s was not found! Please ensure that 'waypoint init' was run with this project.",
"Project %q was not found! Please ensure that 'waypoint init' was run with this project.",
Copy link
Contributor

Choose a reason for hiding this comment

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

TIL about %q! very nice.

@briancain briancain added this to the 0.5.0 milestone Jul 28, 2021
@briancain briancain merged commit a779e23 into main Jul 28, 2021
@briancain briancain deleted the feat/app-poll-handler branch July 28, 2021 17:51
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
4 participants