Skip to content

Add experimental worhflow to build - #20

Closed
pareekpa wants to merge 1 commit into
qualcomm-linux:gfx-kernel.le.0.0from
pareekpa:gfx-kernel.le.0.0_owl
Closed

Add experimental worhflow to build#20
pareekpa wants to merge 1 commit into
qualcomm-linux:gfx-kernel.le.0.0from
pareekpa:gfx-kernel.le.0.0_owl

Conversation

@pareekpa

@pareekpa pareekpa commented Aug 1, 2026

Copy link
Copy Markdown

No description provided.

@pareekpa pareekpa closed this Aug 1, 2026
@qualcomm-ai-code-review-assistant

Copy link
Copy Markdown

Qualcomm AI Review

Click to expand Deep Code Review

Qualcomm AI Deep Code Review Assistant

Code Review: GitHub Actions Workflow owl_build.yml


Key Findings Summary

Total Issues Identified: 9

Severity Count Categories
Critical 1 YAML Syntax
High 3 Configuration, Command Structure, Path Validation
Medium 2 Variable Handling, Path Management
Low 3 Resource Optimization, Artifact Management, Code Style

Primary Concerns:

  • 1 blocking YAML syntax error preventing workflow execution
  • 3 configuration issues causing runtime failures
  • 4 operational issues affecting reliability and maintainability
  • 1 resource optimization opportunity

Risk Assessment: This workflow cannot execute in its current state and requires immediate attention to critical and high-severity issues before deployment.


Critical Issues

1. YAML Syntax Error Preventing Workflow Execution

Severity: Critical
Category: Bug - Syntax Error
Location: .github/workflows/owl_build.yml:33

Problem Description

The workflow contains a fundamental YAML syntax violation that prevents GitHub Actions from parsing the file. The run keyword is missing its required colon separator.

# Current (Invalid)
- name: Build docker image
  run |
    docker image build -t owl_kbuild

Impact Analysis

  • Workflow fails GitHub Actions validation immediately upon commit
  • No steps can execute until resolved
  • Blocks all testing and CI/CD operations
  • Prevents workflow from appearing in Actions UI

Recommended Fix

Add the missing colon after the run keyword:

# Recommended
- name: Build docker image
  run: |
    docker image build -t owl_kbuild

High Severity Issues

2. Missing Required Workflow Input Parameters

Severity: High
Category: Configuration
Location: .github/workflows/owl_build.yml:56, 65, 80, 86

Problem Description

Two critical input parameters (variant and rootfs_matrix) are referenced throughout the workflow but never defined in the workflow_dispatch.inputs section. These undefined inputs are used in:

  • Build workspace action (line 56)
  • Flat build generation (line 65)
  • Bash loops for processing (lines 80, 86)
# Current workflow_dispatch section lacks these inputs
on:
  workflow_dispatch:
    inputs:
      docker_image:
        description: 'Docker image to use for build'
        required: true
      # Missing: variant and rootfs_matrix

Impact Analysis

  • Build steps receive null/undefined values causing immediate failures
  • JSON parsing operations fail when processing rootfs_matrix
  • Users cannot provide required parameters through UI
  • Workflow cannot complete successfully

Recommended Fix

Add the missing input definitions to the workflow_dispatch section:

on:
  workflow_dispatch:
    inputs:
      docker_image:
        description: 'Docker image to use for build'
        required: true
      variant:
        description: 'Build variant to compile'
        required: true
        type: string
      rootfs_matrix:
        description: 'JSON array of rootfs configurations'
        required: true
        type: string

3. Incomplete Docker Build Command

Severity: High
Category: Bug - Command Structure
Location: .github/workflows/owl_build.yml:34

Problem Description

The docker build command is missing the required build context argument, making it syntactically invalid.

# Current (Invalid)
run: |
  docker image build -t owl_kbuild

Impact Analysis

  • Command fails with error: "docker build requires exactly 1 argument"
  • Workflow halts at this step
  • Subsequent steps cannot execute

Recommended Fix

Add the build context path to complete the command:

# Recommended
run: |
  docker image build -t owl_kbuild .

Note: This fix addresses the syntax issue, but see issue #7 regarding whether this step should exist at all.


4. Missing Directory Validation Before Archive Creation

Severity: High
Category: Bug - Path Validation
Location: .github/workflows/owl_build.yml:72

Problem Description

The workflow attempts to change directory and create a tar archive without validating that the target directory exists.

# Current (No validation)
run: |
  cd $workspace/../kobj/tar-install
  tar -cJf $workspace/../artifacts/modules.tar.xz .

Impact Analysis

  • If directory doesn't exist, cd fails and tar executes in wrong location
  • May create empty or incorrect archives
  • Subsequent steps expecting valid artifacts will fail
  • Error messages are non-obvious and difficult to debug

Recommended Fix

Add directory existence validation with clear error messaging:

# Recommended
run: |
  if [ ! -d "$workspace/../kobj/tar-install" ]; then
    echo "Error: Directory $workspace/../kobj/tar-install does not exist"
    exit 1
  fi
  cd $workspace/../kobj/tar-install
  tar -cJf $workspace/../artifacts/modules.tar.xz .

Medium Severity Issues

5. Unquoted Variable in Bash Conditional

Severity: Medium
Category: Bug - Variable Handling
Location: .github/workflows/owl_build.yml:103

Problem Description

The bash conditional test uses an unquoted variable expansion, which can cause syntax errors if the variable is empty or contains whitespace.

# Current (Unsafe)
if [ ${{ steps.build_workspace.outcome }} == 'success' ]

Impact Analysis

  • Summary step may fail with bash syntax errors
  • Particularly problematic since this step uses if: success() || failure() and should always run
  • Users won't see build summary in GitHub Actions UI
  • Debugging becomes more difficult

Recommended Fix

Add proper quoting around the variable:

# Recommended
if [ "${{ steps.build_workspace.outcome }}" == 'success' ]

6. Incorrect Cleanup Paths

Severity: Medium
Category: Bug - Path Management
Location: .github/workflows/owl_build.yml:95-97

Problem Description

The cleanup step uses relative paths that don't match the actual locations where artifacts were created.

# Current (Incorrect paths)
run: |
  rm -rf artifacts
  rm -rf kobj
  rm -f modules.tar.xz

Actual artifact locations:

  • $workspace/../artifacts/
  • $workspace/../kobj/
  • ${{ github.workspace }}/modules.tar.xz

Impact Analysis

  • Cleanup fails silently (rm -rf doesn't error on non-existent paths)
  • Build artifacts accumulate on runners over time
  • Potential disk space issues on self-hosted runners
  • Sensitive artifacts may not be properly removed
  • Subsequent runs may encounter conflicts with leftover files

Recommended Fix

Update paths to match actual artifact locations:

# Recommended
run: |
  rm -rf "$workspace/../artifacts"
  rm -rf "$workspace/../kobj"
  rm -f "${{ github.workspace }}/modules.tar.xz"

Low Severity Issues

7. Unused Docker Image Build Step

Severity: Low
Category: Resource Optimization
Location: .github/workflows/owl_build.yml:31-34

Problem Description

The workflow builds a Docker image named owl_kbuild but never uses it. Instead, all subsequent steps use the image specified by inputs.docker_image.

# Built but never used
- name: Build docker image
  run: |
    docker image build -t owl_kbuild .

# Actual image used in all steps
- name: Build workspace
  uses: ./.github/actions/build_workspace
  with:
    docker_image: ${{ inputs.docker_image }}

Impact Analysis

  • Wastes CI resources and execution time
  • Creates confusion about workflow design intent
  • Suggests incomplete refactoring or leftover code
  • Increases workflow complexity unnecessarily

Recommended Fix

Remove the unused build step entirely:

- - name: Build docker image
-   run: |
-     docker image build -t owl_kbuild .
-
  - name: Build workspace
    uses: ./.github/actions/build_workspace

Alternative: If the intent is to use the built image, update all subsequent steps to reference owl_kbuild instead of inputs.docker_image.


8. Missing Artifact Upload Step

Severity: Low
Category: Artifact Management
Location: .github/workflows/owl_build.yml (after line 91)

Problem Description

The workflow creates a comprehensive file list for artifacts (kernel modules, Image, vmlinux, DTBs, flat meta files) but never uploads them. No actions/upload-artifact step exists.

# File list is created but artifacts are never uploaded
- name: Create file list for artifact upload
  run: |
    echo "$workspace/../artifacts/modules.tar.xz" >> files.txt
    echo "$workspace/../kobj/tar-install/boot/Image" >> files.txt
    # ... more files added to list

Impact Analysis

  • Build artifacts are not preserved or available for download
  • Workflow builds successfully but provides no usable outputs
  • Wastes CI resources building artifacts that are immediately discarded
  • Users cannot access build results
  • Workflow appears incomplete

Recommended Fix

Add an artifact upload step after the file list creation:

- name: Create file list for artifact upload
  run: |
    echo "$workspace/../artifacts/modules.tar.xz" >> files.txt
    echo "$workspace/../kobj/tar-install/boot/Image" >> files.txt
    echo "$workspace/../kobj/tar-install/boot/vmlinux" >> files.txt
    find "$workspace/../kobj/tar-install/boot/dts" -name "*.dtb" >> files.txt
    find "$workspace/../flat_meta" -type f >> files.txt

- name: Upload build artifacts
  uses: actions/upload-artifact@v4
  if: success()
  with:
    name: kernel-build-artifacts-${{ inputs.variant }}
    path: |
      ${{ github.workspace }}/files.txt
    retention-days: 30

9. Inconsistent Path Variable Quoting

Severity: Low
Category: Code Style
Location: .github/workflows/owl_build.yml:90

Problem Description

Line 90 doesn't quote the path variable in the echo statement, inconsistent with other lines (75-77, 82) that properly quote their paths.

# Line 90 (Unquoted)
echo $workspace/../flat_meta >> files.txt

# Lines 75-77 (Properly quoted)
echo "$workspace/../artifacts/modules.tar.xz" >> files.txt
echo "$workspace/../kobj/tar-install/boot/Image" >> files.txt

Impact Analysis

  • Style inconsistency makes code harder to maintain
  • Could cause issues if workspace path contains spaces (unlikely but possible)
  • Violates bash best practices for defensive programming

Recommended Fix

Add quotes for consistency and safety:

# Recommended
echo "$workspace/../flat_meta" >> files.txt

Summary and Recommendations

Immediate Actions Required (Blocking Issues)

  1. Fix YAML syntax error (Issue Create qualcomm-linux-organization-repolinter.yml #1) - Add colon after run keyword
  2. Add missing input parameters (Issue Merge pull request #1 from qualcomm-linux/nbobbaqcom-patch-1 #2) - Define variant and rootfs_matrix inputs
  3. Complete docker build command (Issue Create qualcomm-linux-organization-repolinter.yml #3) - Add build context path
  4. Add directory validation (Issue Create qualcomm-linux-organization-repolinter.yml #4) - Validate paths before operations

High Priority Improvements (Prevent Runtime Failures)

  1. Quote bash variables (Issue Create qualcomm-linux-organization-repolinter.yml #5) - Add quotes in conditional test
  2. Fix cleanup paths (Issue Create qualcomm-linux-organization-repolinter.yml #6) - Use correct absolute paths

Recommended Enhancements (Quality and Completeness)

  1. Remove unused docker build (Issue Create preflight-checker-workflow.yml #7) - Eliminate resource waste
  2. Add artifact upload (Issue Create test.c #8) - Make build outputs accessible
  3. Fix quoting consistency (Issue Fix build warnings #9) - Standardize path handling

Overall Assessment

This workflow is not production-ready and requires significant fixes before deployment. The critical YAML syntax error prevents execution entirely, and multiple high-severity issues would cause runtime failures even after the syntax is corrected. The workflow appears to be in early development stages, as evidenced by incomplete artifact handling and contradictory docker image management.

Estimated Effort: 2-3 hours to implement all recommended fixes and validate functionality.


⚠️ This review was generated using AI assistance. Please verify all suggestions before applying.

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.

1 participant