Repository navigation
Owners page: map failed jobs to their CODEOWNERS teams - #20
Open
ryanmrodriguez wants to merge 1 commit into
Open
ryanmrodriguez wants to merge 1 commit into
ryanmrodriguez wants to merge 1 commit into
Conversation
Add an Owners page listing failed jobs per class, with the owners of each class and counts for the last 1h, 3h, 24h, 3d and 7d. It's off until config.codeowners_path is set, so existing installs see no change. Each class is matched by the file that defines it rather than a naming convention, so components and engines resolve like any other path. A class that can't be loaded or lives outside the repo shows as Unowned. Class names and counts open the Failed list filtered by class and window. That needs a new failed_within filter on JobsQuery. It travels in list_filters, so pagination, tabs, polling and "all matching" bulk actions all see the same rows. The Filter button also now keeps a class filter, and the jobs page shows the class and window it's filtered by. Owner chips and a class search narrow the page in Ruby, since every class is already in memory. Counts only cover jobs that are still failed: Solid Queue deletes a failed execution when its job is retried or discarded.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Problem
When a queue is shared by many teams, the Failed list can't answer "which of these are mine?". Resque setups often solve this with a code owners view. Flightdeck has nothing like it.
Change
An Owners page listing failed jobs per class, with each class's owners and counts for the last 1h, 3h, 24h, 3d and 7d. It's off by default, with one setting to turn it on:
Until that's set there's no sidebar link, and
/ownersshows a short setup message.ActionMailer::MailDeliveryJob), shows as Unowned.failed_withinThe links need a new
failed_withinfilter onJobsQuery. It's carried inlist_filters, so pagination, tabs, polling and "Retry/Discard all matching" all see the same rows. Only failed jobs can have failed recently, so with a window on, All matches Failed and the other tabs show 0.This changes which rows the bulk actions select, so it's the part most worth reviewing. A single-row discard still ignores list filters, as it already does for class and queue.
The Filter button also used to drop an active
class_name. It now keeps it, and the jobs page shows the class and window as chips.Worth knowing
.github. If it's missing, the page says so.failed_executions, which has nocreated_atindex. It's cached forchart_cache_ttl, and the page polls at the chart interval.apply_filtersinjobs_query.rb, so whichever merges second needs a small conflict fix. Class search on the Failed list is currently a prefix match, so the Total row stops linking during a search, because the same search there could show something different.Testing
bin/testpasses: 339 tests in both host modes, on SQLite. Rubocop and the asset check are clean.list_filters.*,**,?,dir/*, escapes and last-match overrides.bin/demoseeds a sample CODEOWNERS and overlapping job classes, so the page can be tried by hand. These live intest/dummyand don't ship in the gem.SUM(CASE WHEN ...)and has no adapter-specific code. The page was checked with HTTP requests against the demo, not in a real browser, and the system tests weren't run.