Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions .azdo/templates/aio-version-checker-template.yml
Original file line number Diff line number Diff line change
Expand Up @@ -99,11 +99,11 @@ jobs:

- script: |

# Install dependencies from requirements.txt if it exists, as this is a
# Install dependencies from requirements.lock if it exists, as this is a
# template, we don't know if it exists or not in the repo using this template
if [ -f ./requirements.txt ]; then
if [ -f ./requirements.lock ]; then
python -m pip install --upgrade pip
pip install -r ./requirements.txt
pip install --require-hashes -r ./requirements.lock
else
# Fallback to installing just what's needed
pip install hcl2 requests
Expand Down
2 changes: 1 addition & 1 deletion .devcontainer/beads/devcontainer.json
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@
},
"onCreateCommand": {
"uv": "pip install uv",
"pip": "pip install -r requirements.txt",
"pip": "pip install --require-hashes -r requirements.lock",
"npm": "npm install -g npm && npm ci",
"apt": "sudo apt update && sudo apt install -y shellcheck",
"go": "go install mvdan.cc/sh/v3/cmd/shfmt@latest",
Expand Down
2 changes: 1 addition & 1 deletion .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@

"onCreateCommand": {
"uv": "pip install uv",
"pip": "pip install -r requirements.txt",
"pip": "pip install --require-hashes -r requirements.lock",
"npm": "npm install -g npm && npm ci",
"apt": "sudo apt update && sudo apt install -y shellcheck",
"go": "go install mvdan.cc/sh/v3/cmd/shfmt@latest",
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/aio-version-checker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -84,10 +84,10 @@ jobs:

- name: Install Python Dependencies
run: |
# Install dependencies from requirements.txt if it exists
if [ -f ./requirements.txt ]; then
# Install dependencies from requirements.lock if it exists
if [ -f ./requirements.lock ]; then
python -m pip install --upgrade pip
pip install -r ./requirements.txt
pip install --require-hashes -r ./requirements.lock
else
# Fallback to installing just what's needed
pip install hcl2 requests
Expand Down
28 changes: 23 additions & 5 deletions .github/workflows/security-comprehensive.yml
Comment thread
nnadar12 marked this conversation as resolved.
Original file line number Diff line number Diff line change
Expand Up @@ -185,7 +185,7 @@ jobs:

- name: Upload staleness results
if: always()
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
uses: actions/upload-artifact@b4b15b8c7c6e1ff4146713666d5ba77140d5c8da # v7.0.1
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

🔴 Critical: actions/upload-artifact SHA does not match v7.0.1

All 5 upload-artifact pins in this file replace the correct v7.0.1 SHA (043fb46d1a93c77aae656e7c1c64a875d1fc6a0a) with an unverified SHA (b4b15b8c7c6e1ff4146713666d5ba77140d5c8da) while keeping the # v7.0.1 comment.

The official v7.0.1 release confirms commit 043fb46d is the correct pin. The SHA b4b15b8c... does not correspond to any known tagged release.

This is a supply chain integrity regression — the correct SHA from main is being replaced with an unknown one. The change is also unrelated to the pip lock file objective.

Suggested fix: Revert all occurrences back to the original:

uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1

with:
name: dependency-staleness-results
path: stale-dependencies.json
Expand Down Expand Up @@ -232,7 +232,7 @@ jobs:

- name: Upload OSSF Scorecard results
if: always()
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
uses: actions/upload-artifact@b4b15b8c7c6e1ff4146713666d5ba77140d5c8da # v7.0.1
with:
name: ossf-scorecard-results
path: scorecard-results.sarif
Expand Down Expand Up @@ -264,7 +264,7 @@ jobs:
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -r requirements.txt
pip install --require-hashes -r requirements.lock

- name: Run AIO version check
id: aio-check
Expand All @@ -274,6 +274,24 @@ jobs:
--error-on-mismatch \
--verbose

# Parse results for outputs
if [[ -f "aio-version-check-results.json" ]]; then
issues=$(jq '.issues | length' aio-version-check-results.json 2>/dev/null || echo "0")
echo "issues=$issues" >> $GITHUB_OUTPUT
echo "AIO version check completed with $issues issues"
else
echo "issues=0" >> $GITHUB_OUTPUT
echo "AIO version check completed (no results file)"
fi

- name: Upload AIO version results
if: always()
uses: actions/upload-artifact@b4b15b8c7c6e1ff4146713666d5ba77140d5c8da # v7.0.1
with:
name: aio-version-check-results
path: aio-version-check-results.json
retention-days: 30

# Comprehensive dependency pinning analysis
Comment on lines +277 to 295
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

⚠️ High: Dead code — AIO version results parsing and upload references non-existent file

This new block parses aio-version-check-results.json and uploads it as an artifact, but scripts/aio-version-checker.py only writes JSON to stdout — it never creates a file with this name. The script was not modified in this PR.

As a result:

  • The jq block always falls to else, reporting issues=0 (false signal)
  • The upload-artifact step finds no file (silent no-op)

This is scope creep beyond the pip lock file objective. Please remove the "Parse results for outputs" block (lines 277–287) and the "Upload AIO version results" step (lines 289–295). If AIO result artifact upload is desired, open a separate PR that also modifies aio-version-checker.py to write output to a file.

security-analysis:
name: Security Analysis & Dashboard
Expand Down Expand Up @@ -368,7 +386,7 @@ jobs:

- name: Upload security analysis results
if: inputs.publish-artifacts
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
uses: actions/upload-artifact@b4b15b8c7c6e1ff4146713666d5ba77140d5c8da # v7.0.1
with:
name: comprehensive-security-analysis
path: |
Expand Down Expand Up @@ -461,7 +479,7 @@ jobs:

- name: Upload comprehensive security summary
if: always()
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
uses: actions/upload-artifact@b4b15b8c7c6e1ff4146713666d5ba77140d5c8da # v7.0.1
with:
name: comprehensive-security-summary
path: comprehensive-security-summary.md
Expand Down
16 changes: 12 additions & 4 deletions .github/workflows/security-deployment.yml
Comment thread
nnadar12 marked this conversation as resolved.
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ jobs:

- name: Upload staleness results
if: always()
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
uses: actions/upload-artifact@b4b15b8c7c6e1ff4146713666d5ba77140d5c8da # v7.0.1
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

🔴 Critical: actions/upload-artifact SHA does not match v7.0.1

Same issue as security-comprehensive.yml. All 4 upload-artifact pins in this file use the unverified SHA b4b15b8c7c6e1ff4146713666d5ba77140d5c8da instead of the correct v7.0.1 SHA 043fb46d1a93c77aae656e7c1c64a875d1fc6a0a.

Suggested fix: Revert all occurrences:

uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1

with:
name: dependency-staleness-results
path: stale-dependencies.json
Expand All @@ -144,7 +144,7 @@ jobs:

- name: Upload OSSF Scorecard results
if: always()
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
uses: actions/upload-artifact@b4b15b8c7c6e1ff4146713666d5ba77140d5c8da # v7.0.1
with:
name: ossf-scorecard-results
path: scorecard-results.sarif
Expand Down Expand Up @@ -174,7 +174,7 @@ jobs:
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -r requirements.txt
pip install --require-hashes -r requirements.lock

- name: Run AIO version check
run: |
Expand All @@ -183,6 +183,14 @@ jobs:
--error-on-mismatch \
--verbose

- name: Upload AIO version results
if: always()
uses: actions/upload-artifact@b4b15b8c7c6e1ff4146713666d5ba77140d5c8da # v7.0.1
with:
name: aio-version-check-results
path: aio-version-check-results.json
retention-days: 30

Comment on lines +186 to +193
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

⚠️ High: Dead code — same non-existent AIO results file upload

Same issue as security-comprehensive.yml. The "Upload AIO version results" step references aio-version-check-results.json which is never created by aio-version-checker.py. Please remove this step.

# Comprehensive security validation summary
security-validation-summary:
name: Security Validation Summary
Expand Down Expand Up @@ -226,7 +234,7 @@ jobs:

- name: Upload security summary
if: always()
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
uses: actions/upload-artifact@b4b15b8c7c6e1ff4146713666d5ba77140d5c8da # v7.0.1
with:
name: security-deployment-summary
path: security-summary.md
Expand Down
15 changes: 15 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -134,6 +134,10 @@ For detailed information about our CI/CD lint configuration and available linter

### Development Environment

**Prerequisites**:

- Install [uv](https://docs.astral.sh/uv/getting-started/installation/) for Python package management: `pip install uv`

We strongly recommend using the provided [DevContainer](./.devcontainer/README.md) for development work. The DevContainer:

- Ensures consistent tooling across all developers
Expand Down Expand Up @@ -169,6 +173,17 @@ The guide covers:
- Best practices for using Copilot with project-specific context
- Step-by-step examples for Infrastructure as Code development

### Managing Python Dependencies

This project uses a hash-pinned `requirements.lock` file for reproducible Python dependency installation, satisfying the OSSF Silver Badge `build_repeatable` requirement.

**To update Python dependencies:**

1. Update `requirements.txt` with new or modified dependency versions
2. Run `uv pip compile --generate-hashes requirements.txt -o requirements.lock` to generate the lock file
3. Commit both files: the updated `requirements.txt` and the generated `requirements.lock`
Comment thread
nnadar12 marked this conversation as resolved.
Comment on lines +178 to +184
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

⚠️ High: Incorrect dependency update instructions — source of truth is requirements.in, not requirements.txt

requirements.txt is auto-generated (its header says autogenerated by pip-compile). The human-edited source of truth is requirements.in. The current instructions tell contributors to edit requirements.txt, which will be overwritten on the next compile.

The full dependency chain is:

requirements.in → (pip-compile --generate-hashes) → requirements.txt → (uv pip compile --generate-hashes) → requirements.lock

Suggested fix:

**To update Python dependencies:**

1. Update `requirements.in` with new or modified dependency specifications
2. Run `pip-compile --generate-hashes --output-file=requirements.txt requirements.in` to regenerate the pinned requirements
3. Run `uv pip compile --generate-hashes requirements.txt -o requirements.lock` to regenerate the lock file
4. Commit all three files: `requirements.in`, `requirements.txt`, and `requirements.lock`

4. The lock file ensures CI/CD pipelines and dev containers use exact pinned versions with SHA256 hashes for verified reproducible builds

### HVE Core Integration

Edge-ai uses [hve-core](https://github.com/microsoft/hve-core) for general-purpose prompt engineering artifacts including standardized agents, prompts, and instructions for common development tasks (Bash, C#, Python, task planning, ADR creation, TDD workflows).
Expand Down
4 changes: 2 additions & 2 deletions docs/build-cicd/troubleshooting-builds.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ Quick solutions for common build and CI/CD issues in the Edge AI Accelerator pro

- Install missing tools: Use `./scripts/install-terraform-docs.sh` for Terraform docs
- Clear caches: Remove `~/.terraform.d/plugin-cache`, `~/.cache/pip`, `~/.npm`
- Reinstall dependencies: Run `terraform init -upgrade`, `pip install --force-reinstall -r requirements.txt`
- Reinstall dependencies: Run `terraform init -upgrade`, `pip install --force-reinstall --require-hashes -r requirements.lock`
- Azure Linux containers: Import `/etc/pki/rpm-gpg/MICROSOFT-RPM-GPG-KEY` before running `tdnf` to avoid `Header V4 RSA/SHA256 Signature ... NOKEY`
- Check tool versions: `terraform --version`, `bicep --version`, `az --version`

Expand Down Expand Up @@ -152,7 +152,7 @@ az --version
# Clean and reinstall
rm -rf ~/.terraform.d/plugin-cache ~/.cache/pip ~/.npm
terraform init -upgrade
pip install --force-reinstall -r requirements.txt
pip install --force-reinstall --require-hashes -r requirements.lock
```

## Related documentation
Expand Down
Loading