ucoProject / UCO

This repository is for development of the Unified Cyber Ontology.
Apache License 2.0
74 stars 34 forks source link

Expand CI trigger-branches to include multiple develops and unstables #493

Closed ajnelson-nist closed 1 year ago

ajnelson-nist commented 1 year ago

Background

UCO and CASE currently use a testing workflow that reviews proposals' Pull Requests before merging for their respective next releases. The workflow includes downloadable "Nightly" build artifacts. This testing process is documented here.

With the 1.0.0 releases of UCO and CASE, the ontologies now have two "Prerelease" tracks:

Following the Git Flow model, we stage the changes for the next release in develop. That model does not prescribe an exact spelling for the "develop that stages stuff for the next major release," so we need to pick a branch name. Ideally, that branch name will have a pattern that also suits:

This proposal is proposed as a fast-track proposal, lacking ontological or modeling impact, and instead being about revising the development and testing infrastructure. The impact is more scoped to the CDO, UCO, and/or CASE role-equivalence of CASE's Product Manager. From the Ontology Committees, feedback is requested on branch naming schemes, and on whether anything should be added to the CONTRIBUTE.md file or its linked resources. The proposal is also going before the Ontology Committees so we may see an illustration of how a proposal can be drawn across a minor and major release.

Fast-track proposals require a low amount of risk to the ontology and its adopters, and the submitter believes this proposal is acceptably low risk because a reactive, corrective action would be effectively scoped within the ontology to changing Git branch names.

This proposal should be considered scoped to CASE as well as UCO.

Requirements

Requirement 1

UCO needs a branch to serve as a merge target for Pull Requests that are part of the next major release (and thus could wait for possibly a year before merging into develop).

Requirement 2

UCO's Continuous Integration (CI) needs to trigger based on the branch names for:

Requirement 3

This is a request from the current testing-process maintainer, rather than a requirement.

UCO's CI needs to trigger based on the branch names for:

Requirement 4

This is a less certain requirement to the submitter, but the OC should consider it.

The name scheme selected should be able to distinguish between the next major release and the following major release.

Risk / Benefit analysis

Benefits

Risks

Competencies demonstrated

Competency 1

A SHACL class-based constraint in UCO 1.0.0 is proposed for constraining to a narrower subclass. For illustration, UCO 1.0.0's observable:ApplicationAccountFacet contains this shape (excerpted):

observable:ApplicationAccountFacet
    a sh:NodeShape ;
    sh:property [
        sh:class observable:ObservableObject ;
        sh:maxCount "1"^^xsd:integer ;
        sh:nodeKind sh:IRI ;
        sh:path observable:application ;
    ] ;
    sh:targetClass observable:ApplicationAccountFacet ;
    .

Suppose the ontology committee accepts for the next-major release that this should constrain to observable:Application rather than the generic observable:ObservableObject. This can be the implementation for the next-major branch ...

observable:ApplicationAccountFacet
    a sh:NodeShape ;
    sh:property [
        sh:class observable:Application ;  # <-- Changed
        sh:maxCount "1"^^xsd:integer ;
        sh:nodeKind sh:IRI ;
        sh:path observable:application ;
    ] ;
    sh:targetClass observable:ApplicationAccountFacet ;
    .

... and this can be the implementation for develop, for the next minor release:

observable:ApplicationAccountFacet
    a sh:NodeShape ;
    sh:property
        [
            # This PropertyShape is unchanged.
            sh:class observable:ObservableObject ;
            sh:maxCount "1"^^xsd:integer ;
            sh:nodeKind sh:IRI ;
            sh:path observable:application ;
        ] ,
        [
            # This PropertyShape will be dropped in the next major release.
            # The differing constraint is this sh:class line:
            sh:class observable:Application ;
            # The warning in place until the next major release is a message accompanying a sh:Warning severity.
            sh:message "Deprecation notice: the object referenced by observable:application will be required to be an observable:Application in UCO 2.0.0, instead of a generic observable:ObservableObject."@en ;
            sh:severity sh:Warning ;
            sh:path observable:application ;
        ]
        ;
    sh:targetClass observable:ApplicationAccountFacet ;
    .

Competency Question 1.1

What is an example process for deprecation of genericity of a constraint, i.e. implementing a backwards-incompatible constraint-tightening?

Result 1.1

This process could be followed to implement a backwards-incompatible change with a warning of it coming:

  1. Implement the backwards-incompatible constraint changes in a separate PropertyShape blank node, with a severity to the new shape less severe than the SHACL default sh:Violation.
  2. Merge the new shape into develop.
  3. Remove the deprecation message and warning severity, and move the new constraints into the prior PropertyShape.
  4. Merge the updated shape into develop-2.0.0 (or whatever the "next major" develop branch is).

This process can all be handled on the same day after a single Solutions Approval vote from the OC.

Competency Question 1.2

What is an example process for a deprecation that will play out over two major releases?

Result 1.2

This process is as with result 1.1, except:

Solution suggestion

These solution points should apply to CASE as well as UCO. Also, references to 2.0.0, 3.0.0, etc., should follow that pattern for future major releases.

The below parts of the suggested solution are not necessarily the responsibility of the Ontology Committee, but are an illustration of process impact.

Coordination

ajnelson-nist commented 1 year ago

Depending on the result of the committee decision on removing concept IRIs, our first test of the develop-2.0.0 branch could come with Issue 491.

ajnelson-nist commented 1 year ago

Depending on the result of the committee decision on removing concept IRIs, our first test of the develop-2.0.0 branch could come with Issue 491.

Issue 501 would also be impacted by the deprecation plan.

ajnelson-nist commented 1 year ago

Fodder for the deprecation plan, which I acknowledge is a bit of scope-creep of this issue about making multiple develop branches:

In the early discussions for our ontology versioning strategy, a working group had concluded we should retain concepts for a long period, e.g. 10 years.

If we choose to retain deprecated concepts instead of delete them once a major version rolls around, I suggest we use OWL designations for concept deprecations, in addition to the SHACL warnings.

E.g. in Issue 501, we're looking at deprecating a property. If we choose to retain that property IRI for a long period or indefinitely, it should pick up this designation:

observable:storageCapacityInBytes a owl:DeprecatedProperty .

A SHACL shape can be defined, independent of any UCO class, that enforces the concept not be used:

observable:storageCapacityInBytes-deprecation-shape
    a sh:NodeShape ;
    sh:property [
        a sh:PropertyShape ;
        sh:maxCount 0 ;
        sh:message "The property observable:storageCapacityInBytes is deprecated."@en ;
        sh:path observable:storageCapacityInBytes ;
    ] ;
    sh:targetSubjectsOf observable:storageCapacityInBytes ;
    .