diff --git a/.allspice/component_validation.py b/.allspice/component_validation.py index 508e178..df187ab 100755 --- a/.allspice/component_validation.py +++ b/.allspice/component_validation.py @@ -1,5 +1,10 @@ #!/usr/bin/env python3 +''' +Iterates a bom in csv format and validates all attributes meet some conditions, +logging warnings & exporting a report.md file. +''' + import csv import sys import logging diff --git a/.allspice/review_comment.py b/.allspice/review_comment.py deleted file mode 100755 index 40852f3..0000000 --- a/.allspice/review_comment.py +++ /dev/null @@ -1,51 +0,0 @@ -#!/usr/bin/env python3 - -import argparse -import os -import sys - -from allspice import AllSpice, DesignReview - -if __name__ == "__main__": - parser = argparse.ArgumentParser( - prog="review_comment", description="Comment on a design review with markdown content." - ) - parser.add_argument( - "repository", help="The repo containing the project in the form 'owner/repo'" - ) - parser.add_argument( - "review_number", help="The design review number'" - ) - parser.add_argument( - "source_file", - help=( - "The path to the source file containing the content to post in the comment body." - ), - ) - parser.add_argument( - "--allspice_hub_url", - help="The URL of your AllSpice Hub instance. Defaults to https://hub.allspice.io.", - ) - - auth_token = os.environ.get("ALLSPICE_AUTH_TOKEN") - if auth_token is None: - print("Please set the environment variable ALLSPICE_AUTH_TOKEN") - exit(1) - - auth_token = os.environ.get("ALLSPICE_AUTH_TOKEN") - - args = parser.parse_args() - - pr_number = args.review_number - repo_owner, repo_name = args.repository.split("/") - comment_file = args.source_file - - if args.allspice_hub_url is None: - allspice = AllSpice(token_text=auth_token) - else: - allspice = AllSpice(token_text=auth_token, allspice_hub_url=args.allspice_hub_url) - - design_review = DesignReview.request(allspice, repo_owner, repo_name, pr_number) - - with open(comment_file, "r") as f: - design_review.create_comment(f.read()) diff --git a/.allspice/workflows/bom-gen.yml b/.allspice/workflows/bom-gen.yml index 04d1cd8..f66f4ab 100644 --- a/.allspice/workflows/bom-gen.yml +++ b/.allspice/workflows/bom-gen.yml @@ -44,13 +44,16 @@ jobs: uses: actions/setup-python@v5 with: python-version: '3.11' + # Note: if we add any other dependencies we should include a requirements.txt file - - run: pip install jinja2 py-allspice + - name: Install Python Dependencies + run: pip install jinja2 py-allspice - name: Check Components run: .allspice/component_validation.py ./bom.csv - - name: Comment Results - run: .allspice/review_comment.py --allspice_hub_url ${{ github.server_url }} ${{ github.repository }} ${{ github.event.number }} ./.allspice/report.md - env: - ALLSPICE_AUTH_TOKEN: ${{ github.token }} + - name: Post Comment on Design Review + uses: https://hub.allspice.io/Actions/post-dr-comment@v0.1 + with: + # The path to the markdown file containing the comment body. + comment_path: .allspice/report.md diff --git a/BeagleY-AI_SCH.pdf b/BeagleY-AI_SCH.pdf index 23f6391..1e3573d 100644 Binary files a/BeagleY-AI_SCH.pdf and b/BeagleY-AI_SCH.pdf differ diff --git a/design/BeagleY-AI_SCH_Rev A_240426.DSN b/design/BeagleY-AI_SCH_Rev A_240426.DSN index 554456a..cda0a64 100644 Binary files a/design/BeagleY-AI_SCH_Rev A_240426.DSN and b/design/BeagleY-AI_SCH_Rev A_240426.DSN differ