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: uploading qcow image to GitHub releases as an asset #210

Merged

Conversation

venkatamutyala
Copy link
Contributor

@venkatamutyala venkatamutyala commented Nov 25, 2024

PR Type

enhancement, other


Description

  • Enhanced the QEMU configuration by increasing the number of cores to 8 and threads to 16 for better performance.
  • Updated the GitHub Actions workflow to allow manual dispatch with an optional input for specifying a tag/version.
  • Modified the Packer build command to utilize the new input variable for the tag/version.
  • Added steps to split the qcow2 image into parts and upload them to GitHub Releases as assets.

Changes walkthrough 📝

Relevant files
Enhancement
qemu.pkr.hcl
Increase cores and threads for QEMU configuration               

qemu.pkr.hcl

  • Increased the number of cores to 8.
  • Increased the number of threads to 16.
  • Added a newline at the end of the file.
  • +3/-1     
    packer-qemu.yml
    Enhance workflow to upload qcow2 image to GitHub Releases

    .github/workflows/packer-qemu.yml

  • Added manual workflow dispatch with optional input for tag/version.
  • Modified Packer build command to use the new input variable.
  • Added steps to split and upload qcow2 image to GitHub Releases.
  • +18/-7   

    💡 PR-Agent usage: Comment /help "your question" on any pull request to receive relevant information

    @venkatamutyala venkatamutyala changed the title Feat uploading qcow image to GitHub releases as an asset feat: uploading qcow image to GitHub releases as an asset Nov 25, 2024
    Copy link

    PR Reviewer Guide 🔍

    Here are some key observations to aid the review process:

    ⏱️ Estimated effort to review: 2 🔵🔵⚪⚪⚪
    🧪 No relevant tests
    🔒 No security concerns identified
    ⚡ Recommended focus areas for review

    Possible Bug
    The tar command is missing the file to archive. The command should specify what file to include in the archive.

    File Handling
    Moving and splitting large files could fail if there's insufficient disk space. Consider adding disk space checks before these operations.

    Release Configuration
    The upload to GitHub release step has 'tags: true' but doesn't specify draft/prerelease status or target commitish, which might lead to unintended release behaviors.

    Copy link

    PR Code Suggestions ✨

    Explore these optional code suggestions:

    CategorySuggestion                                                                                                                                    Score
    Possible issue
    Fix missing input file in tar command that would prevent archive creation

    The tar command is missing the input file, which will cause the archive creation to
    fail. Add the file path to the tar command.

    .github/workflows/packer-qemu.yml [60]

    -tar -cvf ${{ inputs.glueops_codespace_tag || github.event.workflow_run.head_branch }}.qcow2.tar
    +tar -cvf ${{ inputs.glueops_codespace_tag || github.event.workflow_run.head_branch }}.qcow2.tar ../${{ inputs.glueops_codespace_tag || github.event.workflow_run.head_branch }}.qcow2
    • Apply this suggestion
    Suggestion importance[1-10]: 10

    Why: The tar command is critically flawed as it's missing the input file to archive, which would cause the workflow to fail. This fix is essential for the core functionality of creating the archive.

    10
    General
    Use more precise file pattern matching for uploading split files

    The file pattern for uploading to GitHub releases is too specific and may miss some
    split files. Use a more inclusive pattern.

    .github/workflows/packer-qemu.yml [68]

    -file: "*.qcow2.tar.part_*"
    +file: "${{ inputs.glueops_codespace_tag || github.event.workflow_run.head_branch }}.qcow2.tar.part_*"
    • Apply this suggestion
    Suggestion importance[1-10]: 7

    Why: The more specific file pattern ensures only the intended split files are uploaded, preventing potential upload of unrelated files and making the workflow more robust and secure.

    7

    💡 Need additional feedback ? start a PR chat

    @venkatamutyala
    Copy link
    Contributor Author

    /describe

    Copy link

    PR Description updated to latest commit (2622d81)

    NichArchA82
    NichArchA82 previously approved these changes Nov 25, 2024
    @venkatamutyala venkatamutyala merged commit badc523 into main Nov 25, 2024
    3 checks passed
    @venkatamutyala venkatamutyala deleted the feat-uploading-qcow-image-to-github-releases-as-an-asset branch November 25, 2024 09:03
    Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
    Projects
    None yet
    Development

    Successfully merging this pull request may close these issues.

    2 participants