Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions changelog.d/fixed-15540.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
- Dashboard settings help marks for the auto-merge, label-driven approval, sentinel, GitHub API budget and Delivery SLA settings now open the operator-reference section that explains them instead of the index page.
1 change: 1 addition & 0 deletions changelog.d/fixed-15890.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
- dashboard: point operator-reference help marks at the section sub-pages (#15890)
15 changes: 14 additions & 1 deletion src/pkg/dashboard/settings_help_11213_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import (
"testing"
)

var settingHelpCallRE = regexp.MustCompile(`settingHelpMark\('([\w-]+)', '([\w-]*)', `)
var settingHelpCallRE = regexp.MustCompile(`settingHelpMark\('([\w/-]+)', '([\w-]*)', `)

// TestSettingHelpMarksAreDocsLinks keeps every Settings help mark on the same
// "?" docs-link convention as the dashboard card marks (#11213).
Expand Down Expand Up @@ -68,3 +68,16 @@ func TestSettingHelpMarksAreDocsLinks(t *testing.T) {
}
}
}

// TestSettingHelpMarksSkipOperatorReferenceStub keeps help marks on the
// operator-reference section sub-pages instead of the stub index (#15540).
func TestSettingHelpMarksSkipOperatorReferenceStub(t *testing.T) {
html := indexHTML(t)
if strings.Contains(html, "settingHelpMark('operator-reference',") {
t.Error("a settingHelpMark still targets the operator-reference stub page; point it at operator-reference/<section>")
}
fn := jsFunctionBody(t, html, "function dashboardDocsHrefFromPath(path)")
if !strings.Contains(fn, `(?:\/[\w-]+)*`) {
t.Error("dashboardDocsHrefFromPath must accept section sub-page paths such as /docs/operator-reference/README.md")
}
}
14 changes: 7 additions & 7 deletions src/pkg/dashboard/static-src/js/config-features.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 4 additions & 4 deletions src/pkg/dashboard/static-src/js/config-governor.js
Original file line number Diff line number Diff line change
Expand Up @@ -386,7 +386,7 @@
['open_to_merge_h', 'Open → merge', 'Hours from the issue opening on GitHub to the fixing PR merging.'],
];
return `<div class="config-field mb-7">
<label>Delivery SLA targets (hours) ${settingHelpMark('operator-reference', 'delivery-sla', 'Delivery SLA targets', `Per-span budgets the Throughput section's Delivery SLA tiles and sparklines are coloured against: green within target, amber up to ${PRT_SLA_WARN_RATIO}× target, red beyond. 0 restores the default (${defaults.start_to_pr_h} / ${defaults.pr_to_merge_h} / ${defaults.open_to_merge_h} h).`)}</label>
<label>Delivery SLA targets (hours) ${settingHelpMark('operator-reference/sweeps-and-operations', 'delivery-sla', 'Delivery SLA targets', `Per-span budgets the Throughput section's Delivery SLA tiles and sparklines are coloured against: green within target, amber up to ${PRT_SLA_WARN_RATIO}× target, red beyond. 0 restores the default (${defaults.start_to_pr_h} / ${defaults.pr_to_merge_h} / ${defaults.open_to_merge_h} h).`)}</label>
<div class="config-field-row">${fields.map(([key, label, tip]) => {
const v = dirty[key] !== undefined ? dirty[key] : (eff[key] !== undefined ? eff[key] : defaults[key]);
return `<div class="config-field" data-setting-key="sla.targets.${esc(key)}"><label for="cfg-sla-${esc(key)}" title="${esc(tip)}">${esc(label)}</label><input type="number" min="0" max="8760" step="0.5" id="cfg-sla-${esc(key)}" value="${esc(String(v))}" data-input-action="markDirty" data-arg0="sla" data-arg1="${esc(key)}" data-arg-types="s,s,N" data-setting-path="sla.targets.${esc(key)}" aria-label="${esc(label)} target in hours"></div>`;
Expand Down Expand Up @@ -1131,15 +1131,15 @@
${anyLabelDriven ? `<div class="ld-defaults" id="cfg-label-driven-defaults">
<div class="config-toggle">
<div class="config-toggle-switch ${ldApproval.trustOrgMembers !== false ? 'on' : ''} ${ldLocked ? 'disabled' : ''}" data-action="${ldLocked ? '' : 'toggleLabelDrivenTrustOrgMembers'}" data-arg-types="t" title="Prow's own rule: public members of the repo's org may apply the approval label. Off: only triage/write/maintain/admin collaborators and trusted bots."></div>
<span class="config-toggle-label">Label-driven repos: trust public org members to apply approval labels ${settingHelpMark('operator-reference', 'label-driven-approval', 'Trust org members', 'When on (default), a public member of the repository owner org who applies the approval label is trusted, matching Prow. Collaborators with the triage role or higher are always trusted.')}</span>
<span class="config-toggle-label">Label-driven repos: trust public org members to apply approval labels ${settingHelpMark('operator-reference/README', 'label-driven-approval', 'Trust org members', 'When on (default), a public member of the repository owner org who applies the approval label is trusted, matching Prow. Collaborators with the triage role or higher are always trusted.')}</span>
</div>
<div class="config-field-row">
<div class="config-field">
<label>Default approval labels ${settingHelpMark('operator-reference', 'label-driven-approval', 'Default approval labels', 'Comma-separated. Applies to every label-driven repo without its own list. Empty restores triage/accepted.')}</label>
<label>Default approval labels ${settingHelpMark('operator-reference/README', 'label-driven-approval', 'Default approval labels', 'Comma-separated. Applies to every label-driven repo without its own list. Empty restores triage/accepted.')}</label>
<input type="text" id="cfg-label-driven-approval-labels" ${ldLocked ? 'disabled' : ''} value="${esc(ldDefaultLabels.join(', '))}" placeholder="triage/accepted" data-change-action="setLabelDrivenApprovalDefault" data-arg-types="v">
</div>
<div class="config-field">
<label>Trusted bots ${settingHelpMark('operator-reference', 'label-driven-approval', 'Trusted bots', 'Comma-separated bot logins (for example kubestellar-prow[bot]) whose label additions count as a trusted triager. Empty restores the built-in list.')}</label>
<label>Trusted bots ${settingHelpMark('operator-reference/README', 'label-driven-approval', 'Trusted bots', 'Comma-separated bot logins (for example kubestellar-prow[bot]) whose label additions count as a trusted triager. Empty restores the built-in list.')}</label>
<input type="text" id="cfg-label-driven-trusted-bots" ${ldLocked ? 'disabled' : ''} value="${esc((ldApproval.trustedBots || []).join(', '))}" placeholder="kubestellar-prow[bot]" data-change-action="setLabelDrivenTrustedBots" data-arg-types="v">
</div>
</div>
Expand Down
Loading
Loading