Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: apple/swift-container-plugin
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: 1.0.1
Choose a base ref
...
head repository: apple/swift-container-plugin
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: 1.0.2
Choose a head ref
  • 2 commits
  • 13 files changed
  • 1 contributor

Commits on Jul 1, 2025

  1. cherry-pick: ContainerRegistry: Reject invalid repository names (#141)

    Motivation
    ----------
    
    Cherry pick of #138.
    
    `ImageReference` does not check for illegal characters in parsed image
    references. This means that `containertool` will send illegal image
    names to the registry. The registry will reject them, but the error
    message might not explain why, so a generic error message will be
    printed. Runtimes reject illegal image references immediately, without
    sending them to the registry.
    
    Modifications
    -------------
    
    * Introduce a `Repository` wrapper type
    * Check validity when constructing the `Repository`
    * Change the low-level API functions to accept `Repository` instead of
    `String`.
    
    Result
    ------
    
    It is impossible to create a `Repository` object containing a malformed
    name, because the constructor checks the string value. It is impossible
    to send a malformed name to the registry because the API wrappers only
    accept `Repository` objects.
    
    Fixes #135 
    
    Test Plan
    ---------
    
    Existing tests continue to pass.
    New tests exercise additional checks which were previously missing.
    euanh authored Jul 1, 2025
    Configuration menu
    Copy the full SHA
    0658594 View commit details
    Browse the repository at this point in the history
  2. ContainerRegistry: Reject invalid image tags and digests (#142)

    Motivation
    ----------
    
    Cherry pick of #140.
    
    `ImageReference` does not check for illegal characters in parsed image
    digests and tags. This means that `containertool` will send illegal
    image
    names to the registry. The registry will reject them, but the error
    message might not explain why, so a generic error message will be
    printed. Runtimes reject illegal image references immediately, without
    sending them to the registry.
    
    Some desktop runtimes accept local image names which the registry will
    reject; other runtimes reject these names even for local names.
    `containertool`
    now also rejects them.
    
    Modifications
    -------------
    
    * Check validity of tags and digests when parsing image names
    * Change the low-level API functions to accept `Digest` or `Reference`
    instead of `String`.
    
    Result
    ------
    
    It is impossible to create a `Repository` object containing a malformed
    tag or digest, because the constructor checks the string value. It is
    impossible
    to send a malformed name to the registry because the API wrappers only
    accept `Digest` or `Reference (Digest | Tag)` objects.
    
    Fixes #139 
    
    Test Plan
    ---------
    
    Existing tests continue to pass.
    New tests exercise additional checks which were previously missing.
    Removed tests which checked tags which seemed to be accepted by some
    desktop runtimes, but which were not accepted by registries.
    euanh authored Jul 1, 2025
    Configuration menu
    Copy the full SHA
    4ffc546 View commit details
    Browse the repository at this point in the history
Loading