Skip to content

Conversation

@opsiff
Copy link
Member

@opsiff opsiff commented Mar 5, 2025

chore: Check Config Consistency CI for arm64

Summary by Sourcery

CI:

  • Add a new CI workflow to check the consistency of the deepin_arm64_desktop_defconfig file for the ARM64 architecture.

@sourcery-ai
Copy link

sourcery-ai bot commented Mar 5, 2025

Reviewer's Guide by Sourcery

This pull request introduces a new GitHub Actions workflow (check-config-arm64.yml) to ensure the consistency of the deepin_arm64_desktop_defconfig file for the ARM64 architecture. The workflow automates the process of generating a new defconfig and comparing it against the original, flagging any discrepancies.

No diagrams generated as the changes look simple and do not need a visual representation.

File-Level Changes

Change Details Files
Added a new GitHub Actions workflow to check the consistency of the deepin_arm64_desktop_defconfig file for the ARM64 architecture.
  • Created a new workflow file check-config-arm64.yml.
  • Configured the workflow to run on push and pull requests.
  • Specified the ubuntu-24.04-arm runner.
  • Added steps to checkout the repository, install build dependencies, backup the original defconfig, generate a new defconfig, and compare the defconfig files.
  • Implemented an error message if the defconfig files are inconsistent, instructing the user to run make savedefconfig and commit the updates.
.github/workflows/check-config-arm64.yml

Tips and commands

Interacting with Sourcery

  • Trigger a new review: Comment @sourcery-ai review on the pull request.
  • Continue discussions: Reply directly to Sourcery's review comments.
  • Generate a GitHub issue from a review comment: Ask Sourcery to create an
    issue from a review comment by replying to it. You can also reply to a
    review comment with @sourcery-ai issue to create an issue from it.
  • Generate a pull request title: Write @sourcery-ai anywhere in the pull
    request title to generate a title at any time. You can also comment
    @sourcery-ai title on the pull request to (re-)generate the title at any time.
  • Generate a pull request summary: Write @sourcery-ai summary anywhere in
    the pull request body to generate a PR summary at any time exactly where you
    want it. You can also comment @sourcery-ai summary on the pull request to
    (re-)generate the summary at any time.
  • Generate reviewer's guide: Comment @sourcery-ai guide on the pull
    request to (re-)generate the reviewer's guide at any time.
  • Resolve all Sourcery comments: Comment @sourcery-ai resolve on the
    pull request to resolve all Sourcery comments. Useful if you've already
    addressed all the comments and don't want to see them anymore.
  • Dismiss all Sourcery reviews: Comment @sourcery-ai dismiss on the pull
    request to dismiss all existing Sourcery reviews. Especially useful if you
    want to start fresh with a new review - don't forget to comment
    @sourcery-ai review to trigger a new review!
  • Generate a plan of action for an issue: Comment @sourcery-ai plan on
    an issue to generate a plan of action for it.

Customizing Your Experience

Access your dashboard to:

  • Enable or disable review features such as the Sourcery-generated pull request
    summary, the reviewer's guide, and others.
  • Change the review language.
  • Add, remove or edit custom review instructions.
  • Adjust other review settings.

Getting Help

- name: Install build dependencies
run: |
sudo apt-get update
sudo apt-get install -y bc build-essential zstd flex bison libssl-dev make libelf-dev git debhelper pahole libncurses-dev
Copy link

Choose a reason for hiding this comment

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

WARNING: Prefer a maximum 75 chars per line (possible unwrapped commit description?)


- name: Compare defconfig files (ARM64)
run: |
if ! diff -u defconfig defconfig.orig; then
Copy link

Choose a reason for hiding this comment

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

WARNING: Possible repeated word: 'defconfig'

@deepin-ci-robot
Copy link

deepin pr auto review

代码审查意见如下:

  1. 工作流名称

    • 工作流名称 Check defconfig Consistency ARM64 可以更具体一些,例如 Check ARM64 Defconfig Consistency,以便更清晰地表达其功能。
  2. 触发事件

    • 工作流目前只监听 pushpull_request 事件,建议添加 schedule 事件,以便定期检查配置文件的一致性。
  3. 运行环境

    • 使用 ubuntu-24.04-arm 作为运行环境,确保该环境支持 ARM64 架构,并且所有依赖项在该环境中可用。
  4. 依赖项安装

    • 使用 sudo apt-get install 安装依赖项,建议在 run 命令前添加 sudo -E 以确保环境变量在子进程中可用。
  5. 备份原始配置文件

    • 备份原始配置文件时,建议使用 cp 命令的 -v 选项以显示详细信息。
  6. 生成新配置文件

    • 生成新配置文件时,建议在 make 命令前添加 source /etc/profile 以确保环境变量正确设置。
  7. 比较配置文件

    • 比较配置文件时,使用 diff -u 生成差异,并输出错误信息,但未提供修复建议。建议在输出错误信息时提供修复建议。
  8. 代码风格

    • 代码中存在一些格式问题,例如 run 命令中的多行字符串应该对齐,以提高可读性。
  9. 错误处理

    • 在比较配置文件时,如果发现不一致,应该提供修复建议,并确保错误信息清晰明了。
  10. 安全性

    • 使用 sudo 执行命令,确保只有必要的权限,并且定期更新依赖项以防止安全漏洞。

综合以上意见,修改后的代码如下:

name: Check ARM64 Defconfig Consistency

on:
  push:
  pull_request:
  schedule:
    - cron: '0 0 * * *'

jobs:
  check-defconfig:
    runs-on: ubuntu-24.04-arm

    steps:
    - name: Checkout repository
      uses: actions/checkout@v4

    - name: Install build dependencies
      run: |
        sudo -E apt-get update
        sudo -E apt-get install -y bc build-essential zstd flex bison libssl-dev make libelf-dev git debhelper pahole libncurses-dev

    - name: Backup original defconfig (ARM64)
      run: |
        cp -v arch/arm64/configs/deepin_arm64_desktop_defconfig defconfig.orig

    - name: Generate new defconfig (ARM64)
      run: |
        source /etc/profile
        make ARCH=arm64 deepin_arm64_desktop_defconfig
        make ARCH=arm64 savedefconfig

    - name: Compare defconfig files (ARM64)
      run: |
        if ! diff -u defconfig defconfig.orig; then
          echo "::error:: deepin_arm64_desktop_defconfig 文件不一致,请执行 'make savedefconfig' 并提交更新"
          exit 1
        fi

Copy link

@sourcery-ai sourcery-ai bot left a comment

Choose a reason for hiding this comment

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

Hey @opsiff - I've reviewed your changes - here's some feedback:

Overall Comments:

  • Consider using a consistent naming scheme for your workflow files (e.g., check-config.yml and check-config-arm64.yml).
  • The error message is in Chinese; consider providing an English translation for better accessibility.
Here's what I looked at during the review
  • 🟢 General issues: all looks good
  • 🟢 Security: all looks good
  • 🟢 Testing: all looks good
  • 🟢 Complexity: all looks good
  • 🟢 Documentation: all looks good

Sourcery is free for open source - if you like our reviews please consider sharing them ✨
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.

@Avenger-285714
Copy link
Member

/lgtm

@Avenger-285714
Copy link
Member

/approve

@deepin-ci-robot
Copy link

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: Avenger-285714

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@Avenger-285714 Avenger-285714 merged commit 911e3df into linux-6.6.y Mar 6, 2025
8 of 14 checks passed
@opsiff opsiff deleted the linux-6.6.y-2025-03-05-ci-check-config branch March 13, 2025 05:14
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.

4 participants