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

Betabuilds2 #949

Merged
merged 6 commits into from
May 14, 2024
Merged

Betabuilds2 #949

merged 6 commits into from
May 14, 2024

Conversation

kolipakakondal
Copy link
Collaborator

@kolipakakondal kolipakakondal commented May 14, 2024

Description

Please include a summary of the change and which issue is fixed.

Fixes # (IEP-XXX)

Type of change

Please delete options that are not relevant.

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • This change requires a documentation update

How has this been tested?

Please describe the tests that you ran to verify your changes. Provide instructions so we can reproduce. Please also list any relevant details for your test configuration

  • Test A
  • Test B

Test Configuration:

  • ESP-IDF Version:
  • OS (Windows,Linux and macOS):

Dependent components impacted by this PR:

  • Component 1
  • Component 2

Checklist

  • PR Self Reviewed
  • Applied Code formatting
  • Added Documentation
  • Added Unit Test
  • Verified on all platforms - Windows,Linux and macOS

Summary by CodeRabbit

  • Chores
    • Updated CI workflow triggers to run on master branch and pull requests to master.
    • Improved notarization process for macOS DMG files.
    • Retained commented-out sections for potential future use.

Copy link

coderabbitai bot commented May 14, 2024

Walkthrough

The changes across the .github/workflows/ci_beta.yml file aim to streamline CI workflow triggers and enhance the notarization process for macOS files. Key adjustments involve transitioning the trigger mechanism from tags to branches, focusing on the master branch and pull requests, and refining the notarization steps for macOS DMG files. Sections with commented-out code related to notarization and artifact uploads are preserved for potential future utilization.

Changes

File Path Change Summary
.github/workflows/ci_beta.yml - Trigger changed from tags to branches and pull_request for master.
- Updated printf command.
- Enhanced notarization for Espressif-IDE-macosx-cocoa-x86_64.dmg.
- Retained commented-out sections for notarization and artifact uploads.

🐇
In the code, we tweak and play,
Triggers shift in a new way.
Notarize the DMGs tight,
For a workflow that's just right.
Commented lines, they stay for now,
Ready for a future vow.
Hopping forward, swift and neat,
Our CI dance is now complete!


Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?

Share
Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>.
    • Generate unit testing code for this file.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai generate unit testing code for this file.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai generate interesting stats about this repository and render them as a table.
    • @coderabbitai show all the console.log statements in this repository.
    • @coderabbitai read src/utils.ts and generate unit testing code.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (invoked as PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger a review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai help to get help.

Additionally, you can add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.

CodeRabbit Configration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

@kolipakakondal kolipakakondal marked this pull request as draft May 14, 2024 18:21
Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 2

Review Details

Configuration used: CodeRabbit UI
Review profile: CHILL

Commits Files that changed from the base of the PR and between 38f5e19 and 092663f.
Files selected for processing (1)
  • .github/workflows/ci_beta.yml (3 hunks)
Additional comments not posted (2)
.github/workflows/ci_beta.yml (2)

6-15: Update triggers to branches and pull requests targeting master.

Ensure that the new triggers align with the intended workflow and that the workflow is correctly triggered on the specified events.

Verification successful

Workflow triggers are correctly configured

The workflow triggers in the .github/workflows/ci_beta.yml file are correctly set to trigger on push and pull request events targeting the master branch.

  • The push event is configured to trigger on the master branch.
  • The pull_request event is also configured to trigger on the master branch.
Scripts Executed

The following scripts were executed for the analysis:


Script:

#!/bin/bash
# Description: Verify the workflow triggers.

# Test: Check the workflow file for the correct trigger configuration.
rg --type yaml $'on:\n  push:\n    branches: \[ master \]\n  pull_request:\n    branches: \[ master \]' .github/workflows/ci_beta.yml

Length of output: 322



Script:

#!/bin/bash
# Description: Verify the workflow triggers with multiline support.

# Test: Check the workflow file for the correct trigger configuration using multiline mode.
rg --multiline --type yaml $'on:\n  push:\n    branches: \[ master \]\n  pull_request:\n    branches: \[ master \]' .github/workflows/ci_beta.yml

Length of output: 220


71-89: Update notarization steps for Espressif-IDE-macosx-cocoa-x86_64.dmg.

Ensure that the notarization steps are correctly configured and that the commented-out sections are intentional and documented.

Verification successful

Update notarization steps for Espressif-IDE-macosx-cocoa-x86_64.dmg.

The notarization steps are correctly configured in the workflow file. The commented-out sections are intentional and documented.

Scripts Executed

The following scripts were executed for the analysis:


Script:

#!/bin/bash
# Description: Verify the notarization steps.

# Test: Check the workflow file for the correct notarization configuration.
rg --type yaml $'    - name: Notarize Espressif-IDE-macosx-cocoa-x86_64.dmg\n      env: \n        NOTARIZATION_USERNAME: \${{ secrets.NOTARIZATION_USERNAME }}\n        NOTARIZATION_PASSWORD: \${{ secrets.NOTARIZATION_PASSWORD }}\n      run: |\n        echo "Create keychain profile"\n        xcrun notarytool store-credentials "ide-notarytool-profile" --apple-id "\$NOTARIZATION_USERNAME" --team-id "\$NOTARIZATION_TEAM_ID" --password "\$NOTARIZATION_PASSWORD"\n        echo "Notarization of Espressif-IDE-macosx-cocoa-x86_64.dmg"\n        xcrun notarytool submit \$PWD/releng/ide-dmg-builder/Espressif-IDE-macosx-cocoa-x86_64.dmg --keychain-profile "ide-notarytool-profile" --wait\n        echo "Attach staple"\n        xcrun stapler staple \$PWD/releng/ide-dmg-builder/Espressif-IDE-macosx-cocoa-x86_64.dmg' .github/workflows/ci_beta.yml

Length of output: 1928



Script:

#!/bin/bash
# Description: Verify the notarization steps.

# Test: Check the workflow file for the correct notarization configuration.
rg --type yaml 'name: Notarize Espressif-IDE-macosx-cocoa-x86_64.dmg' .github/workflows/ci_beta.yml -A 10

Length of output: 1385

@@ -29,7 +34,7 @@ jobs:
export JARSIGNER_ALIAS=${{secrets.JARSIGNER_REL_ALIAS}}
KEYSTORE_FILE="${PWD}/{{secrets.JARSIGNER_KEYSTORE}}"
echo "${KEYSTORE_FILE}"
printf "%s" "${JARSIGNER_KEYSTORE_B64}" | base64 -d - > "${KEYSTORE_FILE}"
printf "%s" "${JARSIGNER_KEYSTORE_B64}" | base64 -d > "${KEYSTORE_FILE}"
Copy link

Choose a reason for hiding this comment

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

Ensure secure handling of secrets.

The secrets are being handled securely, but ensure that the KEYSTORE_FILE is properly cleaned up after use to avoid any potential security risks.

- rm -v "${KEYSTORE_FILE}"
+ shred -u "${KEYSTORE_FILE}"

Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation.

Suggested change
printf "%s" "${JARSIGNER_KEYSTORE_B64}" | base64 -d > "${KEYSTORE_FILE}"
printf "%s" "${JARSIGNER_KEYSTORE_B64}" | base64 -d > "${KEYSTORE_FILE}"
shred -u "${KEYSTORE_FILE}"

Comment on lines 99 to 172
name: espressif-ide-win32
path: releng/com.espressif.idf.product/target/products/Espressif-IDE-*-win32.win32.x86_64.zip
# - name: Upload windows rcp
# if: ${{ !cancelled() }}
# uses: actions/upload-artifact@v2
# with:
# name: espressif-ide-win32
# path: releng/com.espressif.idf.product/target/products/Espressif-IDE-*-win32.win32.x86_64.zip

- name: Upload linux rcp
if: ${{ !cancelled() }}
uses: actions/upload-artifact@v2
with:
name: espressif-ide-linux
path: releng/com.espressif.idf.product/target/products/Espressif-IDE-*-linux.gtk.x86_64.tar.gz
# - name: Upload linux rcp
# if: ${{ !cancelled() }}
# uses: actions/upload-artifact@v2
# with:
# name: espressif-ide-linux
# path: releng/com.espressif.idf.product/target/products/Espressif-IDE-*-linux.gtk.x86_64.tar.gz


- name: Upload build assets to dl.espressif.com
id: upload-release-asset-espressif
env:
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
AWS_DEFAULT_REGION: ${{ secrets.AWS_DEFAULT_REGION }}
run: |
ARCHIVE_DIR="/releng/com.espressif.idf.update/target/"
ARCHIVE_NAME="com.espressif.idf.update*.zip"
echo "${ARCHIVE_DIR}"
echo ${PWD}${ARCHIVE_DIR}
ARCHIVE_FILE_NAME="$(find ${PWD}${ARCHIVE_DIR}${ARCHIVE_NAME})"
echo "${ARCHIVE_FILE_NAME}"
ARCHIVE_PREFIX="com.espressif.idf.update-"
ARCHIVE_SUFFIX="-SNAPSHOT.zip";
tmp=${ARCHIVE_FILE_NAME#*${ARCHIVE_PREFIX}} # remove prefix
ARCHIVE_VERSION=${tmp%${ARCHIVE_SUFFIX}*} # remove suffix
echo "${ARCHIVE_VERSION}"
FOLDER_NAME="v${ARCHIVE_VERSION}-beta"
mkdir "${FOLDER_NAME}" && cd "${FOLDER_NAME}" && unzip -q ${ARCHIVE_FILE_NAME} && cd ..
echo ${PWD}
ARCHIVE_VERSION_NEW="${ARCHIVE_PREFIX}${ARCHIVE_VERSION}.zip"
echo ${ARCHIVE_VERSION_NEW}
mv ${ARCHIVE_FILE_NAME} ${ARCHIVE_VERSION_NEW}
mv releng/ide-dmg-builder/Espressif-IDE-macosx-cocoa-x86_64.dmg "releng/ide-dmg-builder/Espressif-IDE-macosx-cocoa-x86_64-${FOLDER_NAME}.dmg"
mv releng/ide-dmg-builder/Espressif-IDE-macosx-cocoa-aarch64.dmg "releng/ide-dmg-builder/Espressif-IDE-macosx-cocoa-aarch64-${FOLDER_NAME}.dmg"
aws s3 rm s3://${{ secrets.DL_BUCKET }}/dl/idf-eclipse-plugin/updates/beta --recursive
aws s3 cp --acl=public-read --recursive "./${FOLDER_NAME}/" s3://${{ secrets.DL_BUCKET }}/dl/idf-eclipse-plugin/updates/beta
aws s3 cp --acl=public-read "./releng/index.html" s3://${{ secrets.DL_BUCKET }}/dl/idf-eclipse-plugin/updates/beta/
aws s3 cp --acl=public-read --recursive "./${FOLDER_NAME}/" s3://${{ secrets.DL_BUCKET }}/dl/idf-eclipse-plugin/updates/${FOLDER_NAME}
aws s3 cp --acl=public-read --recursive --exclude "*" --include "Espressif-IDE-*" ./releng/com.espressif.idf.product/target/products/ s3://${{ secrets.DL_BUCKET }}/dl/idf-eclipse-plugin/ide/
aws s3 cp --acl=public-read "${ARCHIVE_VERSION_NEW}" s3://${{ secrets.DL_BUCKET }}/dl/idf-eclipse-plugin/updates/
aws s3 cp --acl=public-read "./releng/ide-dmg-builder/Espressif-IDE-macosx-cocoa-x86_64-${FOLDER_NAME}.dmg" s3://${{ secrets.DL_BUCKET }}/dl/idf-eclipse-plugin/ide/
aws s3 cp --acl=public-read "./releng/ide-dmg-builder/Espressif-IDE-macosx-cocoa-aarch64-${FOLDER_NAME}.dmg" s3://${{ secrets.DL_BUCKET }}/dl/idf-eclipse-plugin/ide/
aws cloudfront create-invalidation --distribution-id ${{ secrets.DL_DISTRIBUTION_ID }} --paths "/dl/idf-eclipse-plugin/updates/beta/*"
aws s3api put-object --acl=public-read --bucket espdldata --key "dl/idf-eclipse-plugin/ide/Espressif-IDE-win32.win32.x86_64/beta" --website-redirect-location "/dl/idf-eclipse-plugin/ide/Espressif-IDE-${ARCHIVE_VERSION}-win32.win32.x86_64.zip"
aws s3api put-object --acl=public-read --bucket espdldata --key "dl/idf-eclipse-plugin/ide/Espressif-IDE-macosx-cocoa-x86_64/beta" --website-redirect-location "/dl/idf-eclipse-plugin/ide/Espressif-IDE-macosx-cocoa-x86_64-v${ARCHIVE_VERSION}.dmg"
aws s3api put-object --acl=public-read --bucket espdldata --key "dl/idf-eclipse-plugin/ide/Espressif-IDE-macosx-cocoa-aarch64/beta" --website-redirect-location "/dl/idf-eclipse-plugin/ide/Espressif-IDE-macosx-cocoa-aarch64-v${ARCHIVE_VERSION}.dmg"
aws s3api put-object --acl=public-read --bucket espdldata --key "dl/idf-eclipse-plugin/ide/Espressif-IDE-linux.gtk.x86_64/beta" --website-redirect-location "/dl/idf-eclipse-plugin/ide/Espressif-IDE-${ARCHIVE_VERSION}-linux.gtk.x86_64.tar.gz"
# - name: Upload build assets to dl.espressif.com
# id: upload-release-asset-espressif
# env:
# AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
# AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
# AWS_DEFAULT_REGION: ${{ secrets.AWS_DEFAULT_REGION }}
# run: |
# ARCHIVE_DIR="/releng/com.espressif.idf.update/target/"
# ARCHIVE_NAME="com.espressif.idf.update*.zip"
# echo "${ARCHIVE_DIR}"
# echo ${PWD}${ARCHIVE_DIR}
# ARCHIVE_FILE_NAME="$(find ${PWD}${ARCHIVE_DIR}${ARCHIVE_NAME})"
# echo "${ARCHIVE_FILE_NAME}"
# ARCHIVE_PREFIX="com.espressif.idf.update-"
# ARCHIVE_SUFFIX="-SNAPSHOT.zip";
# tmp=${ARCHIVE_FILE_NAME#*${ARCHIVE_PREFIX}} # remove prefix
# ARCHIVE_VERSION=${tmp%${ARCHIVE_SUFFIX}*} # remove suffix
# echo "${ARCHIVE_VERSION}"
# FOLDER_NAME="v${ARCHIVE_VERSION}-beta"
# mkdir "${FOLDER_NAME}" && cd "${FOLDER_NAME}" && unzip -q ${ARCHIVE_FILE_NAME} && cd ..
# echo ${PWD}
# ARCHIVE_VERSION_NEW="${ARCHIVE_PREFIX}${ARCHIVE_VERSION}.zip"
# echo ${ARCHIVE_VERSION_NEW}
# mv ${ARCHIVE_FILE_NAME} ${ARCHIVE_VERSION_NEW}
# mv releng/ide-dmg-builder/Espressif-IDE-macosx-cocoa-x86_64.dmg "releng/ide-dmg-builder/Espressif-IDE-macosx-cocoa-x86_64-${FOLDER_NAME}.dmg"
# mv releng/ide-dmg-builder/Espressif-IDE-macosx-cocoa-aarch64.dmg "releng/ide-dmg-builder/Espressif-IDE-macosx-cocoa-aarch64-${FOLDER_NAME}.dmg"
# aws s3 rm s3://${{ secrets.DL_BUCKET }}/dl/idf-eclipse-plugin/updates/beta --recursive
# aws s3 cp --acl=public-read --recursive "./${FOLDER_NAME}/" s3://${{ secrets.DL_BUCKET }}/dl/idf-eclipse-plugin/updates/beta
# aws s3 cp --acl=public-read "./releng/index.html" s3://${{ secrets.DL_BUCKET }}/dl/idf-eclipse-plugin/updates/beta/
# aws s3 cp --acl=public-read --recursive "./${FOLDER_NAME}/" s3://${{ secrets.DL_BUCKET }}/dl/idf-eclipse-plugin/updates/${FOLDER_NAME}
# aws s3 cp --acl=public-read --recursive --exclude "*" --include "Espressif-IDE-*" ./releng/com.espressif.idf.product/target/products/ s3://${{ secrets.DL_BUCKET }}/dl/idf-eclipse-plugin/ide/
# aws s3 cp --acl=public-read "${ARCHIVE_VERSION_NEW}" s3://${{ secrets.DL_BUCKET }}/dl/idf-eclipse-plugin/updates/
# aws s3 cp --acl=public-read "./releng/ide-dmg-builder/Espressif-IDE-macosx-cocoa-x86_64-${FOLDER_NAME}.dmg" s3://${{ secrets.DL_BUCKET }}/dl/idf-eclipse-plugin/ide/
# aws s3 cp --acl=public-read "./releng/ide-dmg-builder/Espressif-IDE-macosx-cocoa-aarch64-${FOLDER_NAME}.dmg" s3://${{ secrets.DL_BUCKET }}/dl/idf-eclipse-plugin/ide/
# aws cloudfront create-invalidation --distribution-id ${{ secrets.DL_DISTRIBUTION_ID }} --paths "/dl/idf-eclipse-plugin/updates/beta/*"
# aws s3api put-object --acl=public-read --bucket espdldata --key "dl/idf-eclipse-plugin/ide/Espressif-IDE-win32.win32.x86_64/beta" --website-redirect-location "/dl/idf-eclipse-plugin/ide/Espressif-IDE-${ARCHIVE_VERSION}-win32.win32.x86_64.zip"
# aws s3api put-object --acl=public-read --bucket espdldata --key "dl/idf-eclipse-plugin/ide/Espressif-IDE-macosx-cocoa-x86_64/beta" --website-redirect-location "/dl/idf-eclipse-plugin/ide/Espressif-IDE-macosx-cocoa-x86_64-v${ARCHIVE_VERSION}.dmg"
# aws s3api put-object --acl=public-read --bucket espdldata --key "dl/idf-eclipse-plugin/ide/Espressif-IDE-macosx-cocoa-aarch64/beta" --website-redirect-location "/dl/idf-eclipse-plugin/ide/Espressif-IDE-macosx-cocoa-aarch64-v${ARCHIVE_VERSION}.dmg"
Copy link

Choose a reason for hiding this comment

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

Document the reason for commented-out sections.

Consider adding comments explaining why these sections are commented out to provide context for future maintainers.

# - name: Notarize Espressif-IDE-macosx-cocoa-aarch64.dmg
#   env: 
#     NOTARIZATION_USERNAME: ${{ secrets.NOTARIZATION_USERNAME }}
#     NOTARIZATION_PASSWORD: ${{ secrets.NOTARIZATION_PASSWORD }}
#   run: |
#     echo "Notarization of Espressif-IDE-macosx-cocoa-aarch64.dmg"
#     xcrun altool --notarize-app -f $PWD/releng/ide-dmg-builder/Espressif-IDE-macosx-cocoa-aarch64.dmg -u $NOTARIZATION_USERNAME -p $NOTARIZATION_PASSWORD --primary-bundle-id Espressif-IDE.app
#     # Commented out because...

@kolipakakondal kolipakakondal marked this pull request as ready for review May 14, 2024 19:31
@kolipakakondal kolipakakondal merged commit d6a3dae into master May 14, 2024
4 checks passed
@kolipakakondal kolipakakondal deleted the betabuilds2 branch May 14, 2024 19:33
Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 0

Review Details

Configuration used: CodeRabbit UI
Review profile: CHILL

Commits Files that changed from the base of the PR and between 092663f and b18b8f5.
Files selected for processing (1)
  • .github/workflows/ci_beta.yml (3 hunks)
Files skipped from review as they are similar to previous changes (1)
  • .github/workflows/ci_beta.yml

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