diff --git a/container/oracle/initdb.d/03_sqa_elements.sql b/container/oracle/initdb.d/03_sqa_elements.sql index 252bed9..2c52963 100644 --- a/container/oracle/initdb.d/03_sqa_elements.sql +++ b/container/oracle/initdb.d/03_sqa_elements.sql @@ -4,22 +4,22 @@ alter session set container = XEPDB1; -- Generated by container/oracle/sqa_elements_sql.py from the SQAP's elements.json: do not edit. SET DEFINE OFF; -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 ('ratings-recorded', 'Ops Impact and Code Complexity recorded in the Software Directory', 'Ratings recorded', 'Requirements', '4.4.1', 'https://pages.jlab.org/acc/iac/docs/sqap/latest/04-software-development-life-cycle/#441-requirements', 1, 'REQUIRED', 'REQUIRED', 'REQUIRED', 'REQUIRED', 'draft 8905d54 after 1.0.0'); -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 ('requirements-specification', 'Software Requirements Specification', 'Requirements specification', 'Requirements', '4.4.1', 'https://pages.jlab.org/acc/iac/docs/sqap/latest/04-software-development-life-cycle/#441-requirements', 2, null, 'RECOMMENDED', 'REQUIRED', 'REQUIRED', 'draft 8905d54 after 1.0.0'); -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 ('design-documented', 'Purpose and use documented in source code, README file or similar', 'Purpose and use documented', 'Design', '4.4.2', 'https://pages.jlab.org/acc/iac/docs/sqap/latest/04-software-development-life-cycle/#442-design', 3, 'REQUIRED', 'REQUIRED', 'REQUIRED', 'REQUIRED', 'draft 8905d54 after 1.0.0'); -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 ('design-specification', 'Software Design Specification', 'Design specification', 'Design', '4.4.2', 'https://pages.jlab.org/acc/iac/docs/sqap/latest/04-software-development-life-cycle/#442-design', 4, null, 'RECOMMENDED', 'REQUIRED', 'REQUIRED', 'draft 8905d54 after 1.0.0'); -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 ('acs-dependencies-recorded', 'Dependencies on other ACS products recorded in the build files or README', 'ACS dependencies recorded', 'Design', '4.4.2', 'https://pages.jlab.org/acc/iac/docs/sqap/latest/04-software-development-life-cycle/#442-design', 5, null, 'REQUIRED', 'REQUIRED', 'REQUIRED', 'draft 8905d54 after 1.0.0'); -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 ('source-documentation', 'Source code documentation', 'Source code documentation', 'Development', '4.4.3', 'https://pages.jlab.org/acc/iac/docs/sqap/latest/04-software-development-life-cycle/#443-development', 6, 'RECOMMENDED', 'REQUIRED', 'REQUIRED', 'REQUIRED', 'draft 8905d54 after 1.0.0'); -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 ('version-control', 'Version control', 'Version control', 'Development', '4.4.3', 'https://pages.jlab.org/acc/iac/docs/sqap/latest/04-software-development-life-cycle/#443-development', 7, 'RECOMMENDED', 'REQUIRED', 'REQUIRED', 'REQUIRED', 'draft 8905d54 after 1.0.0'); -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 ('test-plan', 'Software Test Plan', 'Test plan', 'Testing and Verification', '4.4.4', 'https://pages.jlab.org/acc/iac/docs/sqap/latest/04-software-development-life-cycle/#444-testing-and-verification', 8, null, null, 'RECOMMENDED', 'REQUIRED', 'draft 8905d54 after 1.0.0'); -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 ('user-guide', 'User Guide', 'User guide', 'Deployment', '4.4.5', 'https://pages.jlab.org/acc/iac/docs/sqap/latest/04-software-development-life-cycle/#445-deployment', 9, null, null, 'REQUIRED', 'REQUIRED', 'draft 8905d54 after 1.0.0'); -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 ('installed-version', 'Version number, found from the installed instance', 'Installed version shown', 'Deployment', '4.4.5', 'https://pages.jlab.org/acc/iac/docs/sqap/latest/04-software-development-life-cycle/#445-deployment', 10, null, 'REQUIRED', 'REQUIRED', 'REQUIRED', 'draft 8905d54 after 1.0.0'); -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 ('installed-read-only', 'Installed software read-only to its users', 'Read-only install', 'Deployment', '4.4.5', 'https://pages.jlab.org/acc/iac/docs/sqap/latest/04-software-development-life-cycle/#445-deployment', 11, null, 'REQUIRED', 'REQUIRED', 'REQUIRED', 'draft 8905d54 after 1.0.0'); -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 ('issue-tracking', 'Issue Tracking', 'Issue tracking', 'Maintenance', '4.4.6', 'https://pages.jlab.org/acc/iac/docs/sqap/latest/04-software-development-life-cycle/#446-maintenance', 12, null, 'RECOMMENDED', 'REQUIRED', 'REQUIRED', 'draft 8905d54 after 1.0.0'); -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 ('two-maintainers', 'At least two maintainers listed in the Software Directory', 'Two maintainers', 'Maintenance', '4.4.6', 'https://pages.jlab.org/acc/iac/docs/sqap/latest/04-software-development-life-cycle/#446-maintenance', 13, null, null, 'REQUIRED', 'REQUIRED', 'draft 8905d54 after 1.0.0'); -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 ('dependencies-recorded', 'Dependencies and their versions recorded in the build files or README', 'Dependencies recorded', 'Acquired Software', '6.1.5', 'https://pages.jlab.org/acc/iac/docs/sqap/latest/06-reviews-and-audits/#615-required-sqa-elements', 14, 'RECOMMENDED', 'REQUIRED', 'REQUIRED', 'REQUIRED', 'draft 8905d54 after 1.0.0'); -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 ('versions-pinned', 'Versions pinned exactly, in a lock file where the build tool has one', 'Dependency versions pinned', 'Acquired Software', '6.1.5', 'https://pages.jlab.org/acc/iac/docs/sqap/latest/06-reviews-and-audits/#615-required-sqa-elements', 15, null, 'RECOMMENDED', 'REQUIRED', 'REQUIRED', 'draft 8905d54 after 1.0.0'); -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 ('acquired-choice-recorded', 'Choice recorded: purpose, source, license, maintenance status', 'Dependency choices recorded', 'Acquired Software', '6.1.5', 'https://pages.jlab.org/acc/iac/docs/sqap/latest/06-reviews-and-audits/#615-required-sqa-elements', 16, null, 'RECOMMENDED', 'REQUIRED', 'REQUIRED', 'draft 8905d54 after 1.0.0'); -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 ('advisories-watched', 'Advisories and end of support watched by the maintainer', 'Dependency advisories watched', 'Acquired Software', '6.1.5', 'https://pages.jlab.org/acc/iac/docs/sqap/latest/06-reviews-and-audits/#615-required-sqa-elements', 17, null, 'RECOMMENDED', 'REQUIRED', 'REQUIRED', 'draft 8905d54 after 1.0.0'); +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 ('ratings-recorded', 'Ops Impact and Code Complexity recorded in the Software Directory', 'Ratings recorded', 'Requirements', '4.4.1', 'https://code.jlab.org/acc/iac/docs/sqap/-/blob/8905d54/docs/04-software-development-life-cycle.md#441-requirements', 1, 'REQUIRED', 'REQUIRED', 'REQUIRED', 'REQUIRED', 'draft 8905d54 after 1.0.0'); +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 ('requirements-specification', 'Software Requirements Specification', 'Requirements specification', 'Requirements', '4.4.1', 'https://code.jlab.org/acc/iac/docs/sqap/-/blob/8905d54/docs/04-software-development-life-cycle.md#441-requirements', 2, null, 'RECOMMENDED', 'REQUIRED', 'REQUIRED', 'draft 8905d54 after 1.0.0'); +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 ('design-documented', 'Purpose and use documented in source code, README file or similar', 'Purpose and use documented', 'Design', '4.4.2', 'https://code.jlab.org/acc/iac/docs/sqap/-/blob/8905d54/docs/04-software-development-life-cycle.md#442-design', 3, 'REQUIRED', 'REQUIRED', 'REQUIRED', 'REQUIRED', 'draft 8905d54 after 1.0.0'); +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 ('design-specification', 'Software Design Specification', 'Design specification', 'Design', '4.4.2', 'https://code.jlab.org/acc/iac/docs/sqap/-/blob/8905d54/docs/04-software-development-life-cycle.md#442-design', 4, null, 'RECOMMENDED', 'REQUIRED', 'REQUIRED', 'draft 8905d54 after 1.0.0'); +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 ('acs-dependencies-recorded', 'Dependencies on other ACS products recorded in the build files or README', 'ACS dependencies recorded', 'Design', '4.4.2', 'https://code.jlab.org/acc/iac/docs/sqap/-/blob/8905d54/docs/04-software-development-life-cycle.md#442-design', 5, null, 'REQUIRED', 'REQUIRED', 'REQUIRED', 'draft 8905d54 after 1.0.0'); +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 ('source-documentation', 'Source code documentation', 'Source code documentation', 'Development', '4.4.3', 'https://code.jlab.org/acc/iac/docs/sqap/-/blob/8905d54/docs/04-software-development-life-cycle.md#443-development', 6, 'RECOMMENDED', 'REQUIRED', 'REQUIRED', 'REQUIRED', 'draft 8905d54 after 1.0.0'); +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 ('version-control', 'Version control', 'Version control', 'Development', '4.4.3', 'https://code.jlab.org/acc/iac/docs/sqap/-/blob/8905d54/docs/04-software-development-life-cycle.md#443-development', 7, 'RECOMMENDED', 'REQUIRED', 'REQUIRED', 'REQUIRED', 'draft 8905d54 after 1.0.0'); +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 ('test-plan', 'Software Test Plan', 'Test plan', 'Testing and Verification', '4.4.4', 'https://code.jlab.org/acc/iac/docs/sqap/-/blob/8905d54/docs/04-software-development-life-cycle.md#444-testing-and-verification', 8, null, null, 'RECOMMENDED', 'REQUIRED', 'draft 8905d54 after 1.0.0'); +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 ('user-guide', 'User Guide', 'User guide', 'Deployment', '4.4.5', 'https://code.jlab.org/acc/iac/docs/sqap/-/blob/8905d54/docs/04-software-development-life-cycle.md#445-deployment', 9, null, null, 'REQUIRED', 'REQUIRED', 'draft 8905d54 after 1.0.0'); +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 ('installed-version', 'Version number, found from the installed instance', 'Installed version shown', 'Deployment', '4.4.5', 'https://code.jlab.org/acc/iac/docs/sqap/-/blob/8905d54/docs/04-software-development-life-cycle.md#445-deployment', 10, null, 'REQUIRED', 'REQUIRED', 'REQUIRED', 'draft 8905d54 after 1.0.0'); +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 ('installed-read-only', 'Installed software read-only to its users', 'Read-only install', 'Deployment', '4.4.5', 'https://code.jlab.org/acc/iac/docs/sqap/-/blob/8905d54/docs/04-software-development-life-cycle.md#445-deployment', 11, null, 'REQUIRED', 'REQUIRED', 'REQUIRED', 'draft 8905d54 after 1.0.0'); +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 ('issue-tracking', 'Issue Tracking', 'Issue tracking', 'Maintenance', '4.4.6', 'https://code.jlab.org/acc/iac/docs/sqap/-/blob/8905d54/docs/04-software-development-life-cycle.md#446-maintenance', 12, null, 'RECOMMENDED', 'REQUIRED', 'REQUIRED', 'draft 8905d54 after 1.0.0'); +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 ('two-maintainers', 'At least two maintainers listed in the Software Directory', 'Two maintainers', 'Maintenance', '4.4.6', 'https://code.jlab.org/acc/iac/docs/sqap/-/blob/8905d54/docs/04-software-development-life-cycle.md#446-maintenance', 13, null, null, 'REQUIRED', 'REQUIRED', 'draft 8905d54 after 1.0.0'); +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 ('dependencies-recorded', 'Dependencies and their versions recorded in the build files or README', 'Dependencies recorded', 'Acquired Software', '6.1.5', 'https://code.jlab.org/acc/iac/docs/sqap/-/blob/8905d54/docs/06-reviews-and-audits.md#615-required-sqa-elements', 14, 'RECOMMENDED', 'REQUIRED', 'REQUIRED', 'REQUIRED', 'draft 8905d54 after 1.0.0'); +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 ('versions-pinned', 'Versions pinned exactly, in a lock file where the build tool has one', 'Dependency versions pinned', 'Acquired Software', '6.1.5', 'https://code.jlab.org/acc/iac/docs/sqap/-/blob/8905d54/docs/06-reviews-and-audits.md#615-required-sqa-elements', 15, null, 'RECOMMENDED', 'REQUIRED', 'REQUIRED', 'draft 8905d54 after 1.0.0'); +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 ('acquired-choice-recorded', 'Choice recorded: purpose, source, license, maintenance status', 'Dependency choices recorded', 'Acquired Software', '6.1.5', 'https://code.jlab.org/acc/iac/docs/sqap/-/blob/8905d54/docs/06-reviews-and-audits.md#615-required-sqa-elements', 16, null, 'RECOMMENDED', 'REQUIRED', 'REQUIRED', 'draft 8905d54 after 1.0.0'); +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 ('advisories-watched', 'Advisories and end of support watched by the maintainer', 'Dependency advisories watched', 'Acquired Software', '6.1.5', 'https://code.jlab.org/acc/iac/docs/sqap/-/blob/8905d54/docs/06-reviews-and-audits.md#615-required-sqa-elements', 17, null, 'RECOMMENDED', 'REQUIRED', 'REQUIRED', 'draft 8905d54 after 1.0.0'); commit; diff --git a/container/oracle/sqa_elements_sql.py b/container/oracle/sqa_elements_sql.py index de95305..b450efd 100644 --- a/container/oracle/sqa_elements_sql.py +++ b/container/oracle/sqa_elements_sql.py @@ -11,6 +11,11 @@ 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 +revision's folder, for a released revision; in the plan's source on code.jlab.org, at the revision's +commit, for a draft, which the website doesn't publish (its "latest" is the last release, whose +tables may lack the draft's elements). GitLab gives a heading the same anchor as the website. + For a database that already has elements, write the upgrade script by hand from this output: an element's id never changes, so update the rows whose id is already there and insert the rest. """ @@ -22,6 +27,15 @@ import sys SITE = "https://pages.jlab.org/acc/iac/docs/sqap" +SOURCE = "https://code.jlab.org/acc/iac/docs/sqap/-/blob" + + +def section_url(data: dict, url: str) -> str: + """Where an element's section is: url is relative to the file, such as "04-…/#441-requirements".""" + if not data["draft"]: + return f"{SITE}/v{data['version']}/{url}" + page, _, anchor = url.partition("/#") + return f"{SOURCE}/{data['revision']}/docs/{page}.md#{anchor}" LEVELS = ("minimal", "partial", "significant", "full") REQUIREMENTS = {"required": "REQUIRED", "recommended": "RECOMMENDED", None: None} @@ -37,10 +51,8 @@ def sql(data: dict, allow_draft: bool) -> str: raise SystemExit("The file is a draft, not a released revision of the plan (--draft loads it anyway)") if data["draft"]: version = f"draft {data['revision']} after {data['version']}" - folder = "latest" # A draft has no folder of its own on the site else: version = data["version"] - folder = f"v{data['version']}" lines = [ "alter session set container = XEPDB1;", "", @@ -62,7 +74,7 @@ def sql(data: dict, allow_draft: bool) -> str: literal(element["short"]), literal(element["phase"]), literal(element["section"]["number"]), - literal(f"{SITE}/{folder}/{element['section']['url']}"), + literal(section_url(data, element["section"]["url"])), str(weight), *(literal(REQUIREMENTS[element["levels"][level]]) for level in LEVELS), literal(version), diff --git a/container/oracle/upgrade/2.11.1_sqap_draft_section_links.sql b/container/oracle/upgrade/2.11.1_sqap_draft_section_links.sql new file mode 100644 index 0000000..88caf9e --- /dev/null +++ b/container/oracle/upgrade/2.11.1_sqap_draft_section_links.sql @@ -0,0 +1,27 @@ +-- Link each SQA element to its section in the SQAP's source at the loaded draft revision +-- (8905d54) on code.jlab.org, in place of the website's "latest", which is the last released +-- revision (1.0.0) and lacks most of the draft's elements. Run once, as SIM_OWNER, on a database at +-- 2.11.0. The links match container/oracle/initdb.d/03_sqa_elements.sql, which +-- container/oracle/sqa_elements_sql.py writes; nothing else changes. + +SET DEFINE OFF; + +update SIM_OWNER.SQA_ELEMENT set SECTION_URL = 'https://code.jlab.org/acc/iac/docs/sqap/-/blob/8905d54/docs/04-software-development-life-cycle.md#441-requirements' where ELEMENT_ID = 'ratings-recorded'; +update SIM_OWNER.SQA_ELEMENT set SECTION_URL = 'https://code.jlab.org/acc/iac/docs/sqap/-/blob/8905d54/docs/04-software-development-life-cycle.md#441-requirements' where ELEMENT_ID = 'requirements-specification'; +update SIM_OWNER.SQA_ELEMENT set SECTION_URL = 'https://code.jlab.org/acc/iac/docs/sqap/-/blob/8905d54/docs/04-software-development-life-cycle.md#442-design' where ELEMENT_ID = 'design-documented'; +update SIM_OWNER.SQA_ELEMENT set SECTION_URL = 'https://code.jlab.org/acc/iac/docs/sqap/-/blob/8905d54/docs/04-software-development-life-cycle.md#442-design' where ELEMENT_ID = 'design-specification'; +update SIM_OWNER.SQA_ELEMENT set SECTION_URL = 'https://code.jlab.org/acc/iac/docs/sqap/-/blob/8905d54/docs/04-software-development-life-cycle.md#442-design' where ELEMENT_ID = 'acs-dependencies-recorded'; +update SIM_OWNER.SQA_ELEMENT set SECTION_URL = 'https://code.jlab.org/acc/iac/docs/sqap/-/blob/8905d54/docs/04-software-development-life-cycle.md#443-development' where ELEMENT_ID = 'source-documentation'; +update SIM_OWNER.SQA_ELEMENT set SECTION_URL = 'https://code.jlab.org/acc/iac/docs/sqap/-/blob/8905d54/docs/04-software-development-life-cycle.md#443-development' where ELEMENT_ID = 'version-control'; +update SIM_OWNER.SQA_ELEMENT set SECTION_URL = 'https://code.jlab.org/acc/iac/docs/sqap/-/blob/8905d54/docs/04-software-development-life-cycle.md#444-testing-and-verification' where ELEMENT_ID = 'test-plan'; +update SIM_OWNER.SQA_ELEMENT set SECTION_URL = 'https://code.jlab.org/acc/iac/docs/sqap/-/blob/8905d54/docs/04-software-development-life-cycle.md#445-deployment' where ELEMENT_ID = 'user-guide'; +update SIM_OWNER.SQA_ELEMENT set SECTION_URL = 'https://code.jlab.org/acc/iac/docs/sqap/-/blob/8905d54/docs/04-software-development-life-cycle.md#445-deployment' where ELEMENT_ID = 'installed-version'; +update SIM_OWNER.SQA_ELEMENT set SECTION_URL = 'https://code.jlab.org/acc/iac/docs/sqap/-/blob/8905d54/docs/04-software-development-life-cycle.md#445-deployment' where ELEMENT_ID = 'installed-read-only'; +update SIM_OWNER.SQA_ELEMENT set SECTION_URL = 'https://code.jlab.org/acc/iac/docs/sqap/-/blob/8905d54/docs/04-software-development-life-cycle.md#446-maintenance' where ELEMENT_ID = 'issue-tracking'; +update SIM_OWNER.SQA_ELEMENT set SECTION_URL = 'https://code.jlab.org/acc/iac/docs/sqap/-/blob/8905d54/docs/04-software-development-life-cycle.md#446-maintenance' where ELEMENT_ID = 'two-maintainers'; +update SIM_OWNER.SQA_ELEMENT set SECTION_URL = 'https://code.jlab.org/acc/iac/docs/sqap/-/blob/8905d54/docs/06-reviews-and-audits.md#615-required-sqa-elements' where ELEMENT_ID = 'dependencies-recorded'; +update SIM_OWNER.SQA_ELEMENT set SECTION_URL = 'https://code.jlab.org/acc/iac/docs/sqap/-/blob/8905d54/docs/06-reviews-and-audits.md#615-required-sqa-elements' where ELEMENT_ID = 'versions-pinned'; +update SIM_OWNER.SQA_ELEMENT set SECTION_URL = 'https://code.jlab.org/acc/iac/docs/sqap/-/blob/8905d54/docs/06-reviews-and-audits.md#615-required-sqa-elements' where ELEMENT_ID = 'acquired-choice-recorded'; +update SIM_OWNER.SQA_ELEMENT set SECTION_URL = 'https://code.jlab.org/acc/iac/docs/sqap/-/blob/8905d54/docs/06-reviews-and-audits.md#615-required-sqa-elements' where ELEMENT_ID = 'advisories-watched'; + +COMMIT; diff --git a/docs/user-guide/risk-assessment.md b/docs/user-guide/risk-assessment.md index 0060e9a..19a4808 100644 --- a/docs/user-guide/risk-assessment.md +++ b/docs/user-guide/risk-assessment.md @@ -49,13 +49,15 @@ a run or during Scheduled Accelerator Maintenance. Rate each input for the softw and reassess when the software or its use changes. Software not yet written, or a new version 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: +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 (8905d54) whose text is on +code.jlab.org; the SQAP's website has only released revisions. -- **Ops Impact**: [SQAP §4.3.1](https://pages.jlab.org/acc/iac/docs/sqap/latest/04-software-development-life-cycle/#431-ops-impact). -- **Code Complexity**: [SQAP §4.3.2](https://pages.jlab.org/acc/iac/docs/sqap/latest/04-software-development-life-cycle/#432-code-complexity). +- **Ops Impact**: [SQAP §4.3.1](https://code.jlab.org/acc/iac/docs/sqap/-/blob/8905d54/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/8905d54/docs/04-software-development-life-cycle.md#432-code-complexity). Who rates the software, and when, is in [SQAP -§4.3.4](https://pages.jlab.org/acc/iac/docs/sqap/latest/04-software-development-life-cycle/#434-recording-the-control-level). +§4.3.4](https://code.jlab.org/acc/iac/docs/sqap/-/blob/8905d54/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 @@ -96,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://pages.jlab.org/acc/iac/docs/sqap/latest/04-software-development-life-cycle/#433-control-level-table), +table](https://code.jlab.org/acc/iac/docs/sqap/-/blob/8905d54/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 diff --git a/docs/user-guide/sqa-elements.md b/docs/user-guide/sqa-elements.md index 38c8847..ef556f6 100644 --- a/docs/user-guide/sqa-elements.md +++ b/docs/user-guide/sqa-elements.md @@ -23,7 +23,9 @@ elements, and so does the line above the table, so a change of level shows in th Each element has the SQAP's short label, such as **Dependency choices recorded**; hover over it for the SQAP's full wording, such as "Choice recorded: purpose, source, license, maintenance status". Under the label are the element's phase and a link to the section of the SQAP that -describes it. +describes it, in the revision SIM loaded the elements from. While that is a draft, the link opens +the SQAP's source on code.jlab.org at that revision: the SQAP's website publishes only released +revisions, and the latest of those may not have the draft's elements. The checklist holds the elements a product has or lacks as a whole, such as a Software Requirements Specification, a User Guide, version control and issue tracking. What the SQAP asks diff --git a/src/integration/java/org/jlab/sim/PagesIT.java b/src/integration/java/org/jlab/sim/PagesIT.java index 4baa0b6..c9cced3 100644 --- a/src/integration/java/org/jlab/sim/PagesIT.java +++ b/src/integration/java/org/jlab/sim/PagesIT.java @@ -180,6 +180,34 @@ void elementsShowTheirShortLabelWithTheFullRowOnHover() throws Exception { assertEquals("Version control", provided.attr("title")); } + /** + * 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, + * since the website's latest is the last released revision, whose tables may lack the draft's + * elements. + */ + @Test + void elementsLinkToTheSqapRevisionTheyCameFrom() throws Exception { + Document directory = Sim.page("/directory", null); + String footer = directory.selectFirst("#elements-footer").text(); + String section = + directory + .selectFirst("#elements-table tr[data-element-id=two-maintainers] .element-meta a") + .attr("href"); + String stages = directory.selectFirst("#elements-dialog .dialog-links a").attr("href"); + String levels = directory.selectFirst("#risk-dialog .dialog-links a").attr("href"); + + assertTrue(footer.contains("draft "), "the test data is a draft revision: " + footer); + String revision = footer.replaceAll(".*draft (\\S+) after.*", "$1"); + String page = + "https://code.jlab.org/acc/iac/docs/sqap/-/blob/" + + revision + + "/docs/04-software-development-life-cycle.md"; + assertEquals(page + "#446-maintenance", section); + assertEquals(page + "#44-life-cycle-stages", stages); + assertEquals(page + "#43-software-control-levels", levels); + } + /** The elements a workflow's row lists, by the workflow's name exactly. */ private static String provided(Document page, String workflow) { for (Element row : page.select("tbody tr")) { diff --git a/src/main/java/org/jlab/sim/presentation/controller/Directory.java b/src/main/java/org/jlab/sim/presentation/controller/Directory.java index cd1ca6a..2fbb5ea 100644 --- a/src/main/java/org/jlab/sim/presentation/controller/Directory.java +++ b/src/main/java/org/jlab/sim/presentation/controller/Directory.java @@ -60,6 +60,10 @@ public class Directory extends HttpServlet { /** The workflow filter's value for software that has no workflow, where an id names one */ private static final String NO_WORKFLOW = "NONE"; + // Section 4 of the SQAP, when no element says which revision it is from + private static final String SQAP_SECTION_4 = + "https://pages.jlab.org/acc/iac/docs/sqap/latest/04-software-development-life-cycle/"; + @EJB SoftwareService softwareService; @EJB RepositoryService repositoryService; @EJB TopicService topicService; @@ -271,6 +275,9 @@ protected void doGet(HttpServletRequest request, HttpServletResponse response) request.setAttribute("checklistJson", checklistJson); request.setAttribute( "sqapVersion", elementList.isEmpty() ? null : elementList.get(0).getSqapVersion()); + request.setAttribute("sqapStagesUrl", sectionFourUrl(elementList, "44-life-cycle-stages")); + request.setAttribute( + "sqapControlLevelsUrl", sectionFourUrl(elementList, "43-software-control-levels")); if (isLooseModeRequested(request)) { request.getRequestDispatcher("/WEB-INF/views/directory-loose.jsp").forward(request, response); @@ -279,6 +286,24 @@ protected void doGet(HttpServletRequest request, HttpServletResponse response) } } + /** + * A heading of the SQAP's section 4, such as 4.4 Life Cycle Stages, in the revision the elements + * were loaded from: on the page of an element of a 4.4 subsection, whose link goes to the + * website's folder for a released revision and to the source at its commit for a draft. + * + * @param anchor The heading's anchor, the same on the website and in the source + */ + static String sectionFourUrl(List elements, String anchor) { + for (SqaElement element : elements) { + if (element.getSectionNumber() != null && element.getSectionNumber().startsWith("4.4.")) { + String url = element.getSectionUrl(); + int hash = url.indexOf('#'); + return (hash < 0 ? url : url.substring(0, hash)) + "#" + anchor; + } + } + return SQAP_SECTION_4 + "#" + anchor; + } + /** * What is provided for a product without being recorded on it: what its workflow provides for all * the software released with it, then what its repository provides for all its software, each diff --git a/src/main/webapp/WEB-INF/tags/directory-page.tag b/src/main/webapp/WEB-INF/tags/directory-page.tag index 56da6df..d0179e0 100644 --- a/src/main/webapp/WEB-INF/tags/directory-page.tag +++ b/src/main/webapp/WEB-INF/tags/directory-page.tag @@ -325,7 +325,7 @@
SQA Control Level = lookup(Impact, Complexity) @@ -483,7 +483,7 @@

The SQA elements the SQAP asks of a product at control level : . An element nobody has recorded is not a gap. Hover over an element for the SQAP's wording.

<%-- Not a data-table: the Directory is the page's only one, which its scripts and tests rely on.