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

Check additional metadata in projects #14

Merged
merged 11 commits into from
Nov 14, 2024

Conversation

carlescufi
Copy link
Member

@carlescufi carlescufi commented Oct 28, 2024

action: Check additional metadata in projects

Until now this action was only looking at differences in revision for
all the projects in the manifest. However, there are other items of
metadata that can be highly sensitive, and changes to those must be
monitored and reported.

This commit introduces additional checks for the following metadata
items:

- URL: part of the manifest, URL to the project repository
- Submodules: part of the manifest, enabled submodules when running west
  update
- West commands: part of the manifest, pointer to a file defining
  extensions commands for west itself
- module.yml: the Zephyr module metadata file

If any of the items above is added, removed or changed, the DNM label
will not be removed from the Pull Request, in order for a human to
decide if the PR is to be merged or not.

Screenshot:

image

@carlescufi carlescufi force-pushed the module-yml branch 2 times, most recently from 0d5a34f to ea11968 Compare October 28, 2024 15:44
Instead of digging in the different environment variables, take the
GitHub org, repo and PR number directly from the .yml action file. This
makes it easier to test locally and simplifies the code.

Signed-off-by: Carles Cufi <carles.cufi@nordicsemi.no>
Use the standard log() infrastructure for all output.

Signed-off-by: Carles Cufi <carles.cufi@nordicsemi.no>
@carlescufi carlescufi force-pushed the module-yml branch 5 times, most recently from 8233dc1 to c2b193f Compare October 29, 2024 14:34
In order to clarify to the user why a manifest PR is currently marked as
DNM, add a status line that lists the reason(s) that made the action mark
it as non-mergeable, or OK otherwise.

Signed-off-by: Carles Cufi <carles.cufi@nordicsemi.no>
Whenever removing a project, add the DNM labels.

Signed-off-by: Carles Cufi <carles.cufi@nordicsemi.no>
The new revision is just None, so skip checking for impostor commits.

Signed-off-by: Carles Cufi <carles.cufi@nordicsemi.no>
In preparation for its use in other parts of the code later.

Signed-off-by: Carles Cufi <carles.cufi@nordicsemi.no>
@carlescufi carlescufi force-pushed the module-yml branch 3 times, most recently from 3045c95 to 8b9ae49 Compare October 30, 2024 17:26
The manifest project will be treated separately in future commits.

Signed-off-by: Carles Cufi <carles.cufi@nordicsemi.no>
@carlescufi carlescufi force-pushed the module-yml branch 2 times, most recently from 4e144e9 to cb03951 Compare October 31, 2024 14:32
This makes them more visible and easier to spot.

Signed-off-by: Carles Cufi <carles.cufi@nordicsemi.no>
Instead of having multiple sources of truth for the merge (or DNM)
status, use the _get_merge_status() function for both the labeling and
the note.

Signed-off-by: Carles Cufi <carles.cufi@nordicsemi.no>
@carlescufi carlescufi force-pushed the module-yml branch 3 times, most recently from 759dcf8 to 88632d4 Compare November 8, 2024 13:52
@carlescufi carlescufi force-pushed the module-yml branch 2 times, most recently from 94e1610 to c4f8765 Compare November 11, 2024 13:59
@carlescufi carlescufi force-pushed the module-yml branch 11 times, most recently from 54d392f to 1909e09 Compare November 13, 2024 16:26
Until now this action was only looking at differences in revision for
all the projects in the manifest. However, there are other items of
metadata that can be highly sensitive, and changes to those must be
monitored and reported.

This commit introduces additional checks for the following metadata
items:

- URL: part of the manifest, URL to the project repository
- Submodules: part of the manifest, enabled submodules when running west
  update
- West commands: part of the manifest, pointer to a file defining
  extensions commands for west itself
- module.yml: the Zephyr module metadata file

If any of the items above is added, removed or changed, the DNM label
will not be removed from the Pull Request, in order for a human to
decide if the PR is to be merged or not.

Signed-off-by: Carles Cufi <carles.cufi@nordicsemi.no>
@carlescufi carlescufi changed the title Add handling for module.yml changes Check additional metadata in projects Nov 13, 2024
@fabiobaltieri fabiobaltieri merged commit 4419089 into zephyrproject-rtos:main Nov 14, 2024
carlescufi added a commit to carlescufi/zephyr that referenced this pull request Nov 14, 2024
nashif pushed a commit to zephyrproject-rtos/zephyr that referenced this pull request Nov 16, 2024
coreboot-bot pushed a commit to coreboot/zephyr-cros that referenced this pull request Nov 18, 2024
See zephyrproject-rtos/action-manifest#14.

(cherry picked from commit a3cc532)

Original-Signed-off-by: Carles Cufi <carles.cufi@nordicsemi.no>
GitOrigin-RevId: a3cc532
Cr-Build-Id: 8731028481084229505
Cr-Build-Url: https://cr-buildbucket.appspot.com/build/8731028481084229505
Copybot-Job-Name: zephyr-main-copybot-downstream
Change-Id: Iae0c9d24e4c554eba76a1b09b1670e3fc50d28c6
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/third_party/zephyr/+/6028310
Tested-by: Tristan Honscheid <honscheid@google.com>
Commit-Queue: Tristan Honscheid <honscheid@google.com>
Tested-by: ChromeOS Prod (Robot) <chromeos-ci-prod@chromeos-bot.iam.gserviceaccount.com>
Reviewed-by: Tristan Honscheid <honscheid@google.com>
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.

5 participants