// stage makes the batch depend on the scope: the repository key is guarded
113
115
// and, for an environment, its record is required at the version read.
116
+
//
117
+
//hexcheck:ignore suspicious-business-logic-in-adapter validates a settings scope and adds repository and environment existence/version preconditions to a storage batch
114
118
func (s *Settings) stage(ctx context.Context, b *kv.Batch, scope domain.SettingsScope) error {
// existsIn is exists on a snapshot, so a listing and its check agree.
210
+
//
211
+
//hexcheck:ignore suspicious-business-logic-in-adapter validates a settings scope and checks repository and environment keys in the same snapshot as a listing
// stage makes the batch depend on the scope: the repository key is guarded
114
// stage makes the batch depend on the scope: the repository key is guarded
113
// and, for an environment, its record is required at the version read.
115
// and, for an environment, its record is required at the version read.
116
+
//
117
+
//hexcheck:ignore suspicious-business-logic-in-adapter validates a settings scope and adds repository and environment existence/version preconditions to a storage batch
114
func (s *Settings) stage(ctx context.Context, b *kv.Batch, scope domain.SettingsScope) error {
118
func (s *Settings) stage(ctx context.Context, b *kv.Batch, scope domain.SettingsScope) error {
// existsIn is exists on a snapshot, so a listing and its check agree.
209
// existsIn is exists on a snapshot, so a listing and its check agree.
210
+
//
211
+
//hexcheck:ignore suspicious-business-logic-in-adapter validates a settings scope and checks repository and environment keys in the same snapshot as a listing
// Approve numbers the pending issue from mrseq/<repo> (see createNumbered),
217
215
// writes the open issue and its index key and deletes the pending record, in
218
216
// one batch that requires the pending record to be unchanged.
219
-
//
220
-
//hexcheck:ignore suspicious-business-logic-in-adapter only sets the number under a version precondition; the issue itself is built by domain.ApprovedIssue
221
217
func (s *PendingIssues) Approve(ctx context.Context, repo domain.RepoName, id domain.PendingIssueID, now time.Time) (domain.Issue, error) {
// Approve numbers the pending issue from mrseq/<repo> (see createNumbered),
214
// Approve numbers the pending issue from mrseq/<repo> (see createNumbered),
217
// writes the open issue and its index key and deletes the pending record, in
215
// writes the open issue and its index key and deletes the pending record, in
218
// one batch that requires the pending record to be unchanged.
216
// one batch that requires the pending record to be unchanged.
219
-
//
220
-
//hexcheck:ignore suspicious-business-logic-in-adapter only sets the number under a version precondition; the issue itself is built by domain.ApprovedIssue
221
func (s *PendingIssues) Approve(ctx context.Context, repo domain.RepoName, id domain.PendingIssueID, now time.Time) (domain.Issue, error) {
217
func (s *PendingIssues) Approve(ctx context.Context, repo domain.RepoName, id domain.PendingIssueID, now time.Time) (domain.Issue, error) {
// when old is not known, as for a new request or a comment: the keys of mr are
97
97
// then put or deleted, whatever they were). Deleting a key that is not there is
98
98
// not an error.
99
+
//
100
+
//hexcheck:ignore suspicious-business-logic-in-adapter maintains source and target indexes to match the stored merge request open state and branch names
99
101
func indexOpen(b *kv.Batch, old *domain.MergeRequest, mr domain.MergeRequest) {
// Update replaces the merge request with a version precondition.
453
453
//
454
-
//hexcheck:ignore suspicious-business-logic-in-adapter port method name only
454
+
//hexcheck:ignore suspicious-business-logic-in-adapter replaces a versioned record and maintains open-request indexes and the derived mergeability record
// when old is not known, as for a new request or a comment: the keys of mr are
96
// when old is not known, as for a new request or a comment: the keys of mr are
97
// then put or deleted, whatever they were). Deleting a key that is not there is
97
// then put or deleted, whatever they were). Deleting a key that is not there is
98
// not an error.
98
// not an error.
99
+
//
100
+
//hexcheck:ignore suspicious-business-logic-in-adapter maintains source and target indexes to match the stored merge request open state and branch names
99
func indexOpen(b *kv.Batch, old *domain.MergeRequest, mr domain.MergeRequest) {
101
func indexOpen(b *kv.Batch, old *domain.MergeRequest, mr domain.MergeRequest) {
// Update replaces the merge request with a version precondition.
452
// Update replaces the merge request with a version precondition.
453
//
453
//
454
-
//hexcheck:ignore suspicious-business-logic-in-adapter port method name only
454
+
//hexcheck:ignore suspicious-business-logic-in-adapter replaces a versioned record and maintains open-request indexes and the derived mergeability record
// headID parses a commit id of a request; the empty string is the zero id.
215
-
//
216
-
//hexcheck:ignore suspicious-business-logic-in-adapter parses a request field into the domain id and names the field in the error; no rule is decided here
// headID parses a commit id of a request; the empty string is the zero id.
214
// headID parses a commit id of a request; the empty string is the zero id.
215
-
//
216
-
//hexcheck:ignore suspicious-business-logic-in-adapter parses a request field into the domain id and names the field in the error; no rule is decided here
// "settings.allowed_merge_modes" and "settings.failing_checks_block", and
84
84
// nothing else; the optional issues field stands outside the mask, and alone
85
85
// it is a valid update.
86
-
//
87
-
//hexcheck:ignore suspicious-business-logic-in-adapter maps the field mask of the contract to the optional fields of the use case; no rule is decided here
// "settings.allowed_merge_modes" and "settings.failing_checks_block", and
83
// "settings.allowed_merge_modes" and "settings.failing_checks_block", and
84
// nothing else; the optional issues field stands outside the mask, and alone
84
// nothing else; the optional issues field stands outside the mask, and alone
85
// it is a valid update.
85
// it is a valid update.
86
-
//
87
-
//hexcheck:ignore suspicious-business-logic-in-adapter maps the field mask of the contract to the optional fields of the use case; no rule is decided here
@@ -41,8 +41,6 @@ var _ ports.SignatureVerifier = GPG{}
41
41
42
42
// Verify implements ports.SignatureVerifier. signedAt is ignored: see the time
43
43
// policy of GPG.
44
-
//
45
-
//hexcheck:ignore suspicious-business-logic-in-adapter this is the OpenPGP protocol check the port delegates to the adapter; the trust and email rules stay in domain
v = domain.CommitVerification{Format: domain.FormatGPG, Status: domain.StatusBadSignature}
48
46
deferfunc() { // a parser bug must not take the server down
@@ -41,8 +41,6 @@ var _ ports.SignatureVerifier = GPG{}
41
41
42
// Verify implements ports.SignatureVerifier. signedAt is ignored: see the time
42
// Verify implements ports.SignatureVerifier. signedAt is ignored: see the time
43
// policy of GPG.
43
// policy of GPG.
44
-
//
45
-
//hexcheck:ignore suspicious-business-logic-in-adapter this is the OpenPGP protocol check the port delegates to the adapter; the trust and email rules stay in domain
v = domain.CommitVerification{Format: domain.FormatGPG, Status: domain.StatusBadSignature}
45
v = domain.CommitVerification{Format: domain.FormatGPG, Status: domain.StatusBadSignature}
48
deferfunc() { // a parser bug must not take the server down
46
deferfunc() { // a parser bug must not take the server down
Minternal/adapters/sigverify/ssh.go+0-2
@@ -49,8 +49,6 @@ type sshSigBlob struct {
49
49
}
50
50
51
51
// Verify implements ports.SignatureVerifier.
52
-
//
53
-
//hexcheck:ignore suspicious-business-logic-in-adapter this is the SSHSIG protocol check the port delegates to the adapter; the trust and email rules stay in domain
v = domain.CommitVerification{Format: domain.FormatSSH, Status: domain.StatusBadSignature}
56
54
deferfunc() { // a parser bug must not take the server down
@@ -49,8 +49,6 @@ type sshSigBlob struct {
49
}
49
}
50
50
51
// Verify implements ports.SignatureVerifier.
51
// Verify implements ports.SignatureVerifier.
52
-
//
53
-
//hexcheck:ignore suspicious-business-logic-in-adapter this is the SSHSIG protocol check the port delegates to the adapter; the trust and email rules stay in domain
// runArtifacts is the artifacts section of a run, nil when there is nothing to
54
54
// show: no artifacts on this server, a visitor who cannot list them, no
55
55
// artifact, or a failed read, which is logged; the run page never fails for it.
56
-
//
57
-
//hexcheck:ignore suspicious-business-logic-in-adapter builds the artifacts section from the use case results; which errors hide it is presentation, no rule is decided here
58
56
func (s *Server) runArtifacts(ctx context.Context, repo domain.RepoName, p RunPage) *ArtifactsView {
// runArtifacts is the artifacts section of a run, nil when there is nothing to
53
// runArtifacts is the artifacts section of a run, nil when there is nothing to
54
// show: no artifacts on this server, a visitor who cannot list them, no
54
// show: no artifacts on this server, a visitor who cannot list them, no
55
// artifact, or a failed read, which is logged; the run page never fails for it.
55
// artifact, or a failed read, which is logged; the run page never fails for it.
56
-
//
57
-
//hexcheck:ignore suspicious-business-logic-in-adapter builds the artifacts section from the use case results; which errors hide it is presentation, no rule is decided here
58
func (s *Server) runArtifacts(ctx context.Context, repo domain.RepoName, p RunPage) *ArtifactsView {
56
func (s *Server) runArtifacts(ctx context.Context, repo domain.RepoName, p RunPage) *ArtifactsView {
@@ -139,53 +134,6 @@ func (s *Server) compare(ctx context.Context, r *http.Request) (templ.Component,
139
134
return Compare(l, p), http.StatusOK, nil
140
135
}
141
136
142
-
// commitsAhead lists the commits of the source that the target lacks, newest
143
-
// first. exact is false when the walk gave up before finding where the source
144
-
// meets the target. behind is true when the target has commits the source
145
-
// lacks (the tip of the target is not an ancestor of the source).
146
-
//
147
-
//hexcheck:ignore suspicious-business-logic-in-adapter walks the history pages the use case returns to find where the branch left its target; the page needs it, the forge decides nothing
@@ -139,53 +134,6 @@ func (s *Server) compare(ctx context.Context, r *http.Request) (templ.Component,
139
return Compare(l, p), http.StatusOK, nil
134
return Compare(l, p), http.StatusOK, nil
140
}
135
}
141
136
142
-
// commitsAhead lists the commits of the source that the target lacks, newest
143
-
// first. exact is false when the walk gave up before finding where the source
144
-
// meets the target. behind is true when the target has commits the source
145
-
// lacks (the tip of the target is not an ancestor of the source).
146
-
//
147
-
//hexcheck:ignore suspicious-business-logic-in-adapter walks the history pages the use case returns to find where the branch left its target; the page needs it, the forge decides nothing
Reviewed (correctness/security + architecture/maintainability/tests), findings fixed or deferred (GO-005 wiring, GO-011/012 budget loop factoring). Rebased on main 4534992. Build, vet, gofmt, hexcheck -fail-on warn, go test ./internal/... and -race on touched packages pass.