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

ci: add an action to update submodules #174

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

igrr
Copy link
Member

@igrr igrr commented Apr 30, 2023

This PR adds a new CI action to automatically update submodules, opening PRs for updates.

Example PRs can be seen in the fork:

Note, idf_component.yml wasn't updated in these PRs because:

  • for libuvc, this is disabled in .gitmodules since uvc component version is ahead of the upstream version
  • for expat, idf_component.yml version is already set to 2.5.0

in both cases, idf-extra-components maintainers will have to amend the PR to update idf_component.yml manually.

Uses the following Github action:

Description of config options in .gitmodules can be found the README.md of update_submodule_versions action.

TODO

  • Set SUBMODULE_UPDATE_AUTHOR_NAME and SUBMODULE_UPDATE_AUTHOR_EMAIL variables in repository settings after merging
  • Run this workflow with --dry-run in PRs which modify .gitmodules
  • Add default patterns for tag names
  • Fail with an error when no tags matching the given pattern are found
  • Mention this workflow in the contribution guide

Closes #29

@CLAassistant
Copy link

CLAassistant commented Apr 30, 2023

CLA assistant check
All committers have signed the CLA.

autoupdate-branch = main
autoupdate-tag-glob = v[0-9]*.[0-9]*.[0-9]*
autoupdate-manifest = cbor/idf_component.yml
autoupdate-ver-regex = v([0-9]+).([0-9]+).([0-9]+)
Copy link
Member

Choose a reason for hiding this comment

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

Should we consider keeping some default values for branch, tag-glob and ver-regex fields? If we take most common syntax (e.g., version as vx.y.z) then we can reduce the additional fields specified for all external submodules.

Copy link
Member Author

Choose a reason for hiding this comment

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

I kept these explicit in order to force the component maintainer to go and check the tag naming pattern the repository actually uses.

Alternatively I could make the action fail if not a single tag with the given naming pattern is found. In that case I'll also make the action run when .gitmodules file is changed, with a --dry-run argument.

[submodule "esp_delta_ota/detools"]
path = esp_delta_ota/detools
url = https://github.com/eerimoq/detools.git
# not updating automatically, as this is not an upstream repo
Copy link
Member

Choose a reason for hiding this comment

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

We do use source from this repository in our component build. We should add this component in the auto update list.

Copy link
Member Author

Choose a reason for hiding this comment

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

@mahavirj I can add it, but how is the version of the component related to the version of detools? It looks like they aren't related.

Copy link
Member

Choose a reason for hiding this comment

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

Yes, they are not related. Our component follows its own versioning policy here. We can handle the update for this case on-demand basis.

@mahavirj
Copy link
Member

mahavirj commented May 2, 2023

@igrr Do we need any doc guidelines on the auto-update workflow for external submodules?

@tore-espressif
Copy link
Collaborator

LGTM! Let's wait for espressif/github-actions#40

@igrr igrr force-pushed the feature/submodule_update branch from 5276490 to 8fba36e Compare July 18, 2023 17:25
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.

Consider setting up dependabot to update submodule dependencies (IEC-2)
4 participants