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

feat: jargon artifacts validation pipeline #304

Conversation

huynguyen-hl
Copy link
Member

@huynguyen-hl huynguyen-hl commented Feb 13, 2025

What type of PR is this? (check all applicable)

  • πŸ• Feature
  • πŸ› Bug Fix
  • πŸ“ Documentation Update
  • 🎨 Style
  • πŸ§‘β€πŸ’» Code Refactor
  • πŸ”₯ Performance Improvements
  • βœ… Test
  • πŸ€– Build
  • πŸ” CI
  • πŸ“¦ Chore (Release)
  • ⏩ Revert

Description

This PR implements the GitHub workflow jargon-webhooks pipeline, which is triggered when a Jargon snapshot is created.

To set up the webhook, we need to navigate to the specific domain on the Jargon site where we want to configure it, then set up the GitHub dispatch URL and HTTP headers accordingly. Once configured, every time a snapshot is created, Jargon will send a request to the GitHub API to trigger this pipeline and validate its artifacts.

The jargon-webhooks pipeline leverages the validate-jargon-artifacts action to validate JSON-LD contexts and sample credentials against their respective schemas and contexts used within the credentials. This ensures that we can easily determine whether the generated artifacts are valid before proceeding with their release.

Screenshots

Below are some screenshots of my testing for the jargon-webhooks pipeline to ensure it works as expected.

Jargon webhook configuration:

Screenshot 2025-02-13 at 4 18 43β€―PM

Pipeline skipped validation upon receiving a test event:

Screenshot 2025-02-13 at 4 05 13β€―PM

Sample credential validation failed due to a missing required issuer property:

Screenshot 2025-02-13 at 4 06 17β€―PM

Context validation in the credential failed because the protected term cnf was redefined:

Screenshot 2025-02-13 at 4 06 51β€―PM

Context artifact validation failed due to an invalid term ("": ""):

Screenshot 2025-02-13 at 4 07 14β€―PM

The pipeline detected all failed test cases:

  • Sample credential did not conform to its schema.
  • Context in the sample credential failed due to protected term redefinition.
  • Context contained an invalid term.
Screenshot 2025-02-13 at 4 07 32β€―PM

All test cases passed successfully:

Screenshot 2025-02-13 at 4 07 56β€―PM

Copy link
Contributor

@absoludity absoludity left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks excellent @huynguyen-hl . I'm just a bit confused about what is going on in one of the functions below. Can you clarify that for me? Otherwise +1

Copy link
Collaborator

@ashleythedeveloper ashleythedeveloper left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great work Huy.

* @returns {schemas: {fileName: url}, instances: {fileName: url}}
*/

function splitSchemasAndInstances (jsonSchemas) {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As @absoludity mentioned, I feel that we should update the naming convention, but it's good enough for now.

@ashleythedeveloper ashleythedeveloper merged commit e7a19ed into uncefact:main Feb 18, 2025
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants