Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adopt mandatory semantic versioning for TUF specification version #914

Merged
merged 5 commits into from
Sep 16, 2019

Commits on Sep 16, 2019

  1. Update link to historical tuf-spec.0.9.txt

    Signed-off-by: Lukas Puehringer <lukas.puehringer@nyu.edu>
    lukpueh committed Sep 16, 2019
    Configuration menu
    Copy the full SHA
    94d1c51 View commit details
    Browse the repository at this point in the history
  2. Update SPEC_VERSION to semver-compliant 1.0.0

    Updates SPEC_VERSION definition in tuf/__init__.py, test files and
    docstring in formats.build_dict_conforming_to_schema.
    
    Test metadata will be updated in separate commits.
    
    Signed-off-by: Lukas Puehringer <lukas.puehringer@nyu.edu>
    lukpueh committed Sep 16, 2019
    Configuration menu
    Copy the full SHA
    9d201d1 View commit details
    Browse the repository at this point in the history
  3. Re-generate repository and client test metadata

    Re-generate metadata to adopt spec version format change, using
    `generate.py` plus some working around (see script below):
    
    ```
     # QUICKFIX: Patch add_target to pass file paths relative to targets dir
    git apply - <<EOF
    diff --git a/tests/repository_data/generate.py b/tests/repository_data/generate.py
    index 6c263575..699ed00f 100755
    --- a/tests/repository_data/generate.py
    +++ b/tests/repository_data/generate.py
    @@ -119,12 +119,11 @@ if not options.dry_run:
     # about the target (i.e., file permissions in octal format.)
     octal_file_permissions = oct(os.stat(target1_filepath).st_mode)[4:]
     file_permissions = {'file_permissions': octal_file_permissions}
    -repository.targets.add_target(target1_filepath, file_permissions)
    -repository.targets.add_target(target2_filepath)
    +repository.targets.add_target('file1.txt', file_permissions)
    +repository.targets.add_target('file2.txt')
    
    -repository.targets.delegate('role1', [delegation_public],
    -    [os.path.basename(target3_filepath)])
    -repository.targets('role1').add_target(target3_filepath)
    +repository.targets.delegate('role1', [delegation_public], ['file3.txt'])
    +repository.targets('role1').add_target('file3.txt')
     repository.targets('role1').load_signing_key(delegation_private)
    
     repository.targets('role1').delegate('role2', [delegation_public], [])
    EOF
    
     # Remove repository and client data
    cd repository_data && rm -rf repository client
     # Generate metadata
    python generate.py
     # Duplicate metadata files
    cp -r client/test_repository1 client/test_repository2
     # Recover non-signed file
    git checkout client/map.json
    ```
    
    Signed-off-by: Lukas Puehringer <lukas.puehringer@nyu.edu>
    lukpueh committed Sep 16, 2019
    Configuration menu
    Copy the full SHA
    af1a21b View commit details
    Browse the repository at this point in the history
  4. Re-generate projects test metadata

    Re-generate metadata to adopt spec version format change, using
    `generate_project_data.py`:
    
    ```
    cd tests/repository_data && rm -rf project
    python generate_project_data.py
    ```
    
    Signed-off-by: Lukas Puehringer <lukas.puehringer@nyu.edu>
    lukpueh committed Sep 16, 2019
    Configuration menu
    Copy the full SHA
    2e21950 View commit details
    Browse the repository at this point in the history
  5. Mandate semver for SPECIFICATION_VERSION_SCHEMA

    Mandates Semantic Versioning format with
    tuf.formats.SPECIFICATION_VERSION_SCHEMA using the regex referenced
    on the official semver website. See:
    https://semver.org/spec/v2.0.0.html#is-there-a-suggested-regular-expression-regex-to-check-a-semver-string
    https://regex101.com/r/Ly7O1x/3/
    
    Adopts tests accordingly:
     - removes tests that now fail earlier due to stricter format
     - adds tests to check exemplary valid and invalid version schemas
    
    Signed-off-by: Lukas Puehringer <lukas.puehringer@nyu.edu>
    lukpueh committed Sep 16, 2019
    Configuration menu
    Copy the full SHA
    b136584 View commit details
    Browse the repository at this point in the history