Skip to content

Conversation

@ahouseholder
Copy link
Contributor

@ahouseholder ahouseholder commented Sep 8, 2025

This PR adds the ability to use "fragments" after a registered namespace. E.g., ssvc#foo or cisa#bar. This was the intent all along, we just hadn't been testing for it so we missed that while it passed the pattern, it did not pass the validator on the namespace class.

Copilot Summary

This pull request enhances the namespace validation logic and expands the test coverage to handle namespace strings containing fragments (using #). The main updates improve how fragments are parsed and validated, ensuring that such cases are correctly recognized as valid namespaces.

Validation logic improvements:

  • Updated NameSpace.validate to correctly handle and parse fragments in namespace strings by splitting on the fragment separator (#) before validation.

Test coverage enhancements:

  • Added new test cases in test_namespace_validator to confirm that namespace strings with fragments (e.g., ssvc#test) are validated successfully.
  • Extended the pattern test setup to include additional valid namespace examples with fragments, such as ssvc#reference-arch-1 and x_example.test#test.

Code cleanup:

  • Removed an unused import (re) from test_namespaces.py for clarity.

This was the intent all along, we just hadn't been testing for it so we missed that while it passed the pattern, it did not pass the validator on the namespace class.
@ahouseholder ahouseholder self-assigned this Sep 8, 2025
@ahouseholder ahouseholder added bug Something isn't working tech/backend Back-end tools, code, infrastructure labels Sep 8, 2025
@ahouseholder ahouseholder added this to the 2025-09 milestone Sep 8, 2025
@ahouseholder ahouseholder merged commit 0fd6e52 into main Sep 8, 2025
4 checks passed
@ahouseholder ahouseholder deleted the fix-base-namespace-with-fragment branch September 8, 2025 20:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working tech/backend Back-end tools, code, infrastructure

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants