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 container/oracle/initdb.d/02_ddl.sql
Original file line number Diff line number Diff line change
Expand Up @@ -154,6 +154,7 @@ CREATE TABLE SIM_OWNER.SQA_ELEMENT
ELEMENT_ID VARCHAR2(64 CHAR) NOT NULL,
NAME VARCHAR2(256 CHAR) NOT NULL,
SHORT_NAME VARCHAR2(64 CHAR) NOT NULL,
EVIDENCE VARCHAR2(128 CHAR) NOT NULL,
PHASE VARCHAR2(64 CHAR) NOT NULL,
SECTION_NUMBER VARCHAR2(16 CHAR) NOT NULL,
SECTION_URL VARCHAR2(256 CHAR) NOT NULL,
Expand Down
34 changes: 17 additions & 17 deletions container/oracle/initdb.d/03_sqa_elements.sql

Large diffs are not rendered by default.

12 changes: 8 additions & 4 deletions container/oracle/sqa_elements_sql.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,9 @@
python3 container/oracle/sqa_elements_sql.py elements.json > container/oracle/initdb.d/03_sqa_elements.sql

Only the elements whose scope is "product" are loaded: those a product has or lacks as a whole,
which SIM records for each product, each with its short label for lists (a file without the labels,
from before the SQAP gave them, is refused). A file whose "draft" is true is not a released revision of
which SIM records for each product, each with its short label for lists and its evidence, the SQAP's
note on what the product's record links to (a file without either, from before the SQAP gave them, is
refused). A file whose "draft" is true is not a released revision of
the plan: it is refused unless --draft is given, and then the version says that it is a draft.

Each element links to the section of the plan that holds its table: on the plan's website, in the
Expand Down Expand Up @@ -67,11 +68,14 @@ def sql(data: dict, allow_draft: bool) -> str:
continue
if not element.get("short"):
raise SystemExit(f"The element {element['id']!r} has no short label: the file is older than SIM needs")
if not element.get("evidence"):
raise SystemExit(f"The element {element['id']!r} has no evidence: the file is older than SIM needs")
weight += 1
values = [
literal(element["id"]),
literal(element["name"]),
literal(element["short"]),
literal(element["evidence"]),
literal(element["phase"]),
literal(element["section"]["number"]),
literal(section_url(data, element["section"]["url"])),
Expand All @@ -80,8 +84,8 @@ def sql(data: dict, allow_draft: bool) -> str:
literal(version),
]
lines.append(
"insert into SIM_OWNER.SQA_ELEMENT (ELEMENT_ID, NAME, SHORT_NAME, PHASE, SECTION_NUMBER, SECTION_URL,"
" WEIGHT, LEVEL_0, LEVEL_1, LEVEL_2, LEVEL_3, SQAP_VERSION) values (" + ", ".join(values) + ");"
"insert into SIM_OWNER.SQA_ELEMENT (ELEMENT_ID, NAME, SHORT_NAME, EVIDENCE, PHASE, SECTION_NUMBER,"
" SECTION_URL, WEIGHT, LEVEL_0, LEVEL_1, LEVEL_2, LEVEL_3, SQAP_VERSION) values (" + ", ".join(values) + ");"
)
lines += ["", "commit;", ""]
return "\n".join(lines)
Expand Down
35 changes: 35 additions & 0 deletions container/oracle/upgrade/2.12.0_sqa_element_evidence.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
-- Add what a product's record of each SQA element links to, the SQAP's "evidence" for it, which the
-- SQA Elements dialog shows under the link, and load the SQAP's elements of revision draft 0e98a07
-- after 1.0.0 (acc/iac/docs/sqap!24), which gives it. That revision changes nothing else of the
-- elements: each keeps its name, label, phase, order and levels, and links to its section at the
-- new revision.
--
-- Run once, as SIM_OWNER, after 2.11.1_sqap_dependencies_merged.sql, which removes the element that
-- has no evidence. The definition must match container/oracle/initdb.d/02_ddl.sql, and afterwards
-- each SQA_ELEMENT row matches container/oracle/initdb.d/03_sqa_elements.sql, which
-- container/oracle/sqa_elements_sql.py writes.

SET DEFINE OFF;

ALTER TABLE SIM_OWNER.SQA_ELEMENT ADD EVIDENCE VARCHAR2(128 CHAR) NULL;

update SIM_OWNER.SQA_ELEMENT set EVIDENCE = 'The product''s assessment in the Software Directory, which records this itself', SECTION_URL = 'https://code.jlab.org/acc/iac/docs/sqap/-/blob/0e98a07/docs/04-software-development-life-cycle.md#441-requirements', SQAP_VERSION = 'draft 0e98a07 after 1.0.0' where ELEMENT_ID = 'ratings-recorded';
update SIM_OWNER.SQA_ELEMENT set EVIDENCE = 'The specification, in the product''s repository or on its documentation website', SECTION_URL = 'https://code.jlab.org/acc/iac/docs/sqap/-/blob/0e98a07/docs/04-software-development-life-cycle.md#441-requirements', SQAP_VERSION = 'draft 0e98a07 after 1.0.0' where ELEMENT_ID = 'requirements-specification';
update SIM_OWNER.SQA_ELEMENT set EVIDENCE = 'The README, or wherever else the product''s purpose and use are written', SECTION_URL = 'https://code.jlab.org/acc/iac/docs/sqap/-/blob/0e98a07/docs/04-software-development-life-cycle.md#442-design', SQAP_VERSION = 'draft 0e98a07 after 1.0.0' where ELEMENT_ID = 'design-documented';
update SIM_OWNER.SQA_ELEMENT set EVIDENCE = 'The design document, in the product''s repository or on its documentation website', SECTION_URL = 'https://code.jlab.org/acc/iac/docs/sqap/-/blob/0e98a07/docs/04-software-development-life-cycle.md#442-design', SQAP_VERSION = 'draft 0e98a07 after 1.0.0' where ELEMENT_ID = 'design-specification';
update SIM_OWNER.SQA_ELEMENT set EVIDENCE = 'The published API documentation, or the source directory whose code carries it', SECTION_URL = 'https://code.jlab.org/acc/iac/docs/sqap/-/blob/0e98a07/docs/04-software-development-life-cycle.md#443-development', SQAP_VERSION = 'draft 0e98a07 after 1.0.0' where ELEMENT_ID = 'source-documentation';
update SIM_OWNER.SQA_ELEMENT set EVIDENCE = 'The product''s repository', SECTION_URL = 'https://code.jlab.org/acc/iac/docs/sqap/-/blob/0e98a07/docs/04-software-development-life-cycle.md#443-development', SQAP_VERSION = 'draft 0e98a07 after 1.0.0' where ELEMENT_ID = 'version-control';
update SIM_OWNER.SQA_ELEMENT set EVIDENCE = 'The test plan, in the product''s repository or on its documentation website; not the pipeline or the tests', SECTION_URL = 'https://code.jlab.org/acc/iac/docs/sqap/-/blob/0e98a07/docs/04-software-development-life-cycle.md#444-testing-and-verification', SQAP_VERSION = 'draft 0e98a07 after 1.0.0' where ELEMENT_ID = 'test-plan';
update SIM_OWNER.SQA_ELEMENT set EVIDENCE = 'The guide''s website, or the guide in the product''s repository', SECTION_URL = 'https://code.jlab.org/acc/iac/docs/sqap/-/blob/0e98a07/docs/04-software-development-life-cycle.md#445-deployment', SQAP_VERSION = 'draft 0e98a07 after 1.0.0' where ELEMENT_ID = 'user-guide';
update SIM_OWNER.SQA_ELEMENT set EVIDENCE = 'Where an instance shows its version: About page, --version output, startup log, PV or install path', SECTION_URL = 'https://code.jlab.org/acc/iac/docs/sqap/-/blob/0e98a07/docs/04-software-development-life-cycle.md#445-deployment', SQAP_VERSION = 'draft 0e98a07 after 1.0.0' where ELEMENT_ID = 'installed-version';
update SIM_OWNER.SQA_ELEMENT set EVIDENCE = 'The deployment script or procedure, which shows the account that installs each version and where', SECTION_URL = 'https://code.jlab.org/acc/iac/docs/sqap/-/blob/0e98a07/docs/04-software-development-life-cycle.md#445-deployment', SQAP_VERSION = 'draft 0e98a07 after 1.0.0' where ELEMENT_ID = 'installed-read-only';
update SIM_OWNER.SQA_ELEMENT set EVIDENCE = 'The product''s issue tracker, such as its issues on code.jlab.org or GitHub', SECTION_URL = 'https://code.jlab.org/acc/iac/docs/sqap/-/blob/0e98a07/docs/04-software-development-life-cycle.md#446-maintenance', SQAP_VERSION = 'draft 0e98a07 after 1.0.0' where ELEMENT_ID = 'issue-tracking';
update SIM_OWNER.SQA_ELEMENT set EVIDENCE = 'The product''s maintainers in the Software Directory, which records this itself', SECTION_URL = 'https://code.jlab.org/acc/iac/docs/sqap/-/blob/0e98a07/docs/04-software-development-life-cycle.md#446-maintenance', SQAP_VERSION = 'draft 0e98a07 after 1.0.0' where ELEMENT_ID = 'two-maintainers';
update SIM_OWNER.SQA_ELEMENT set EVIDENCE = 'The build file that lists the dependencies, or the README''s section on them', SECTION_URL = 'https://code.jlab.org/acc/iac/docs/sqap/-/blob/0e98a07/docs/06-reviews-and-audits.md#615-required-sqa-elements', SQAP_VERSION = 'draft 0e98a07 after 1.0.0' where ELEMENT_ID = 'dependencies-recorded';
update SIM_OWNER.SQA_ELEMENT set EVIDENCE = 'The lock file; where the build tool has none, the build file or README that gives exact versions', SECTION_URL = 'https://code.jlab.org/acc/iac/docs/sqap/-/blob/0e98a07/docs/06-reviews-and-audits.md#615-required-sqa-elements', SQAP_VERSION = 'draft 0e98a07 after 1.0.0' where ELEMENT_ID = 'versions-pinned';
update SIM_OWNER.SQA_ELEMENT set EVIDENCE = 'The README''s section on dependencies, or the design document''s, with the four facts for each', SECTION_URL = 'https://code.jlab.org/acc/iac/docs/sqap/-/blob/0e98a07/docs/06-reviews-and-audits.md#615-required-sqa-elements', SQAP_VERSION = 'draft 0e98a07 after 1.0.0' where ELEMENT_ID = 'acquired-choice-recorded';
update SIM_OWNER.SQA_ELEMENT set EVIDENCE = 'The Dependabot or scanning settings; without them, a note on who follows upstream advisories', SECTION_URL = 'https://code.jlab.org/acc/iac/docs/sqap/-/blob/0e98a07/docs/06-reviews-and-audits.md#615-required-sqa-elements', SQAP_VERSION = 'draft 0e98a07 after 1.0.0' where ELEMENT_ID = 'advisories-watched';

ALTER TABLE SIM_OWNER.SQA_ELEMENT MODIFY EVIDENCE NOT NULL;

COMMIT;
10 changes: 5 additions & 5 deletions docs/user-guide/risk-assessment.md
Original file line number Diff line number Diff line change
Expand Up @@ -50,14 +50,14 @@ and reassess when the software or its use changes. Software not yet written, or
that a coming operations program needs, can be rated too.

The SQAP defines the two inputs that give the control level, so this guide doesn't repeat them.
Its links go to the SQAP revision this release of SIM loads, a draft (19bcfba) whose text is on
Its links go to the SQAP revision this release of SIM loads, a draft (0e98a07) whose text is on
code.jlab.org; the SQAP's website has only released revisions.

- **Ops Impact**: [SQAP §4.3.1](https://code.jlab.org/acc/iac/docs/sqap/-/blob/19bcfba/docs/04-software-development-life-cycle.md#431-ops-impact).
- **Code Complexity**: [SQAP §4.3.2](https://code.jlab.org/acc/iac/docs/sqap/-/blob/19bcfba/docs/04-software-development-life-cycle.md#432-code-complexity).
- **Ops Impact**: [SQAP §4.3.1](https://code.jlab.org/acc/iac/docs/sqap/-/blob/0e98a07/docs/04-software-development-life-cycle.md#431-ops-impact).
- **Code Complexity**: [SQAP §4.3.2](https://code.jlab.org/acc/iac/docs/sqap/-/blob/0e98a07/docs/04-software-development-life-cycle.md#432-code-complexity).

Who rates the software, and when, is in [SQAP
§4.3.4](https://code.jlab.org/acc/iac/docs/sqap/-/blob/19bcfba/docs/04-software-development-life-cycle.md#434-recording-the-control-level).
§4.3.4](https://code.jlab.org/acc/iac/docs/sqap/-/blob/0e98a07/docs/04-software-development-life-cycle.md#434-recording-the-control-level).
The other four inputs are SIM's own, and only set fragility and attention.

### Past Downtime Rate
Expand Down Expand Up @@ -98,7 +98,7 @@ technology and subject.
The SQA control level says how much process the SQAP asks for when the software changes: 0
**Minimal**, 1 **Partial**, 2 **Significant** or 3 **Full**. SIM derives it from Ops Impact and
Code Complexity with the SQAP's [control level
table](https://code.jlab.org/acc/iac/docs/sqap/-/blob/19bcfba/docs/04-software-development-life-cycle.md#433-control-level-table),
table](https://code.jlab.org/acc/iac/docs/sqap/-/blob/0e98a07/docs/04-software-development-life-cycle.md#433-control-level-table),
and the dialog shows the result as you change them.

An **override** replaces the derived level with another, for an exception the SQAP allows. The
Expand Down
7 changes: 6 additions & 1 deletion docs/user-guide/sqa-elements.md
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ For each element, set:
| Field | Means |
|---|---|
| **Status** | **Met**: the software has the element. **Gap**: it should have it, and doesn't. **Not applicable**: the element doesn't apply to this software. **Not recorded**: nobody has said. |
| **Link** | For an element that is met, where it is: the document, the README, the guide's website. For a gap, the issue that tracks it. A web address that starts with `http://` or `https://`, up to 512 characters. Optional. |
| **Link** | For an element that is met, where it is: the line under the link says what the SQAP expects there, such as "The lock file; where the build tool has none, the build file or README that gives exact versions". For a gap, the issue that tracks it. A web address that starts with `http://` or `https://`, up to 512 characters. Optional. |
| **Note** | Anything else, up to 512 characters. **Not applicable** needs a note that says why. |

Then select **Save**. SIM saves the checklist and reloads the page. **Cancel**, the × in the
Expand All @@ -107,6 +107,11 @@ change that for the elements you left as they were.
Once an element has a link, **Open** beside it opens the link in a new window, for anyone reading
the checklist, logged in or not.

The line under each link comes from the SQAP with the elements, and says where to look, not what
the element must contain: follow the element's section link for that. Several elements can have
the same link, as the four about dependencies do when one section of the README covers them. The
two elements SIM sets have no link, and no line.

**Met** means somebody says the software has the element, not that the element is good enough:
SIM doesn't read the document behind the link.

Expand Down
25 changes: 25 additions & 0 deletions src/integration/java/org/jlab/sim/PagesIT.java
Original file line number Diff line number Diff line change
Expand Up @@ -180,6 +180,31 @@ void elementsShowTheirShortLabelWithTheFullRowOnHover() throws Exception {
assertEquals("Version control", provided.attr("title"));
}

/**
* Under each element's link is the SQAP's note on what to link, so that nobody has to guess
* whether, say, the test plan is the pipeline, the tests or a document.
*/
@Test
void elementsSayWhatTheirLinkPointsTo() throws Exception {
Document directory = Sim.page("/directory", null);

assertEquals(
"The lock file; where the build tool has none, the build file or README that gives exact"
+ " versions",
directory
.selectFirst("#elements-table tr[data-element-id=versions-pinned] .element-evidence")
.text());
for (Element row : directory.select("#elements-table tr.element-row")) {
Element evidence = row.selectFirst("td:has(.element-link) .element-evidence");
assertTrue(
evidence != null && !evidence.text().isBlank(),
row.attr("data-element-id") + " says what to link, in the Link column");
}
assertTrue(
directory.selectFirst("#elements-footer").text().contains("the SQAP names in the line"),
"the footer says where the line comes from");
}

/**
* Each SQA element links to its section in the revision of the SQAP it was loaded from, as do the
* dialogs' links to sections 4.4 and 4.3: for a draft, the plan's source at the draft's commit,
Expand Down
11 changes: 11 additions & 0 deletions src/main/java/org/jlab/sim/persistence/entity/SqaElement.java
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,13 @@ public class SqaElement implements Serializable {
@Column(name = "SHORT_NAME", nullable = false, length = 64)
private String shortName;

/**
* The SQAP's note on what a product's record of the element links to, such as "The lock file;
* where the build tool has none, the build file or README that gives exact versions".
*/
@Column(name = "EVIDENCE", nullable = false, length = 128)
private String evidence;

@Column(name = "PHASE", nullable = false, length = 64)
private String phase;

Expand Down Expand Up @@ -91,6 +98,10 @@ public String getShortName() {
return shortName;
}

public String getEvidence() {
return evidence;
}

public String getPhase() {
return phase;
}
Expand Down
3 changes: 2 additions & 1 deletion src/main/webapp/WEB-INF/tags/directory-page.tag
Original file line number Diff line number Diff line change
Expand Up @@ -526,14 +526,15 @@
<input type="url" class="element-link" maxlength="512" placeholder="https://&hellip;" aria-label="Link for ${fn:escapeXml(element.shortName)}"/>
<a class="element-link-open" target="_blank" rel="noopener noreferrer" title="Open the link in a new window" hidden>Open</a>
</div>
<div class="element-evidence"><c:out value="${element.evidence}"/></div>
</td>
<td><input type="text" class="element-note" maxlength="512" aria-label="Note for ${fn:escapeXml(element.shortName)}"/></td>
</tr>
</c:forEach>
</tbody>
</table>
</div>
<div id="elements-footer">Link: the evidence of an element that is met, or the issue that tracks a gap. Not applicable needs a note saying why. An element met by a workflow or a repository is one it provides for all its software; a status recorded here replaces it. SIM sets Ratings recorded and Two maintainers from the assessment and the Maintainers column.<c:if test="${not empty sqapVersion}"> Elements of SQAP revision <c:out value="${sqapVersion}"/>.</c:if></div>
<div id="elements-footer">Link: the evidence of an element that is met, which the SQAP names in the line under it, or the issue that tracks a gap. Not applicable needs a note saying why. An element met by a workflow or a repository is one it provides for all its software; a status recorded here replaces it. SIM sets Ratings recorded and Two maintainers from the assessment and the Maintainers column.<c:if test="${not empty sqapVersion}"> Elements of SQAP revision <c:out value="${sqapVersion}"/>.</c:if></div>
<div class="dialog-button-panel">
<c:choose>
<c:when test="${readonly}">
Expand Down
11 changes: 11 additions & 0 deletions src/main/webapp/resources/css/directory.css
Original file line number Diff line number Diff line change
Expand Up @@ -251,6 +251,16 @@ td.risk .gap-count {
#elements-table .element-row.computed .element-note {
visibility: hidden;
}
/* The SQAP's note on what to link, under the link; what SIM computes says so under its status.
It runs on under the note, whose cell is as wide and holds only its input, to stay on a line or
two: the two cells' widths and the 8px paddings between them */
#elements-table .element-evidence {
margin-top: 2px;
width: calc(200% + 16px);
}
#elements-table .element-row.computed .element-evidence {
display: none;
}
/* The short name; its title is the SQAP's full row */
#elements-table .element-short {
font-weight: bold;
Expand Down Expand Up @@ -287,6 +297,7 @@ td.risk .gap-count {
border-bottom: 1px solid #ddd;
}
#elements-table .element-meta,
#elements-table .element-evidence,
#elements-table .element-recorded,
#elements-table .element-provided,
#elements-footer {
Expand Down
Loading