Repository navigation
Review policy is Harbor's: rules and versions, rounds with their checks, and the pages (0.25.0) - #30
Merged
Merged
Conversation
…their checks, and the pages Harbor::ReviewRule and Harbor::ReviewRuleVersion, Harbor::ReviewRound and Harbor::ReviewCheckRun, Harbor::ReviewFeedback and Harbor::ReviewEscape are the records, on the review_* tables (the migration creates each table, index and foreign key when it is missing). Every save of a rule is a version; a rule is rolled back by saving an earlier definition as the newest. Harbor::Reviews::RuleDefinition checks what a rule says, per kind (risk, check, sign-off), with Harbor::Reviews::Condition for its conditions and Harbor::Reviews::Glob for its path globs. Harbor::Reviews::Document is a round as one document, with its progress, cost and the line that says where it is. Harbor::ReviewsController, ReviewRulesController, ReviewRoundsController and ReviewDashboardsController serve /factory/reviews: the policy, a rule's page and form with its versions, a round with its checks (and its .json), and the dashboard. The menu's Review policy entry is the engine's own route. A site with no code of its own writes and versions its rules on the page, and sees a round with its checks once something records one. Harbor does not run reviews yet: deciding which rules a pull request owes, running the checks and publishing the result stay with the host, which writes rounds into these records. A host declares its own risk detectors and finding categories (Harbor::Reviews), names its subclasses (review_rule_class, review_rule_version_class) and its document's schema (review_document_schema), says where pull requests are (review_pull_request_url), previews a rule its own way (review_rule_preview, review_rule_preview_sample) and says what the reviews cost (review_cost). It adds to the pages with harbor/reviews/_round_review and harbor/shared/_quality_guide. Every saved version goes to config.export. 0.25.0.
adamfortuna
force-pushed
the
review-policy
branch
from
November 15, 2026 00:08
ee8feca to
2f6311e
Compare
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.
Review policy moves into Harbor: the records, what a rule may say, and the pages. Harbor does not run reviews yet; the host's own flow writes rounds into these records and the pages show them.
What Harbor owns now
review_*tables (one migration, every table, index and foreign key created only when missing):Harbor::ReviewRuleandHarbor::ReviewRuleVersion(every save a version, roll back as a new version),Harbor::ReviewRoundandHarbor::ReviewCheckRun,Harbor::ReviewFeedbackandHarbor::ReviewEscape.Harbor::Reviews::RuleDefinitionper kind (risk, check, sign-off),Harbor::Reviews::Condition(check and describe a condition) andHarbor::Reviews::Glob.Harbor::Reviews::DocumentwithProgressand the round's title.Harbor.path, gated bypage_reviews: the policy (/factory/reviews), a rule's page and form with versions and roll back, a round with its checks (and.json), and the dashboard. The menu entry is the engine's own route.What a host supplies (all optional)
Harbor::Reviews.detectorandHarbor::Reviews.finding_category.config.review_rule_class,config.review_rule_version_class,config.review_document_schema,config.review_pull_request_url,config.review_rule_preview(+review_rule_preview_sample),config.review_cost.harbor/reviews/_round_review,harbor/shared/_quality_guide.config.export.With none of it set: no Preview buttons, pull requests are named but not linked, the dashboard has no "Code review" tile, and the document's schema is
harbor.review/v1.Notes for rebasing onto 0.23.0 and 0.24.0
Harbor::Reviews::Conditionis the validate/describe half of the workflow condition language. Once Workflows is in, it can become a thin alias of that one.harbor/shared/quality_guidewhen it exists. The Scorers and Proposals release adds that partial with the same locals, so the guide appears with no change here.CHANGELOG.md,README.md(a "Review policy" section before "Webhooks", three lines under "Configuring"),lib/harbor/nav.rb(one entry getsscope: :harbor),lib/harbor/configuration.rb(one block),lib/harbor.rb,config/routes.rb(one block),test/dummy/db/schema.rb, and the menu assertions intest/section_test.rb,test/host_pages_test.rbandtest/nav_test.rb.Tests
test/review_policy_test.rb(records, definitions, the document, export, host classes) andtest/review_pages_test.rb(a site with no code of its own writes a rule, edits it, sees and rolls back its versions, and sees a round with its checks; then each hook and partial).