gazebo-tooling / gzdev

Gazebo developers tool is an Outreachy project designed to facilitate many of the usual tasks that Gazebo developers face daily
Other
14 stars 3 forks source link

Simplify the process of using prereleases for testing in a PR #65

Open azeey opened 2 years ago

azeey commented 2 years ago

Currently, we have to create a PR against gzdev in order to use prereleases for the libraries needed by the PR. It would be nice if gzdev could also read a file in the root of the library repo (e.g., gz-sim/.ci/repository.yaml) with a similar format as repository.yaml and merge that with its own repository.yaml giving precedence to the settings found in the library repo. For example, if I want to use a prerelease of sdformat12 for testing my gz-sim PR, I would just add

projects:
    - name: sdformat12
      repositories:
          - name: osrf
            type: prerelease

in gz-sim/.ci/repository.yaml. Once the PR is tested with the prerelease, we would make a stable release of sdformat and remove this file from the PR.

This is just a suggestion. I'm open to other ideas to make it easier to do testing with prereleases. Ideally, it would be something that would be included/modified in the PR we're testing, not in gzdev or elsewhere.

scpeters commented 1 year ago

I think it would be easy enough to add a GZDEV_USE_PRERELEASE or GZDEV_USE_NIGHTLY empty file similar to the COLCON_IGNORE files either in the root of the repository or in the .github/ci/ folder. We can update the actions and Jenkins CI scripts to check for this file

azeey commented 1 year ago

If it's safe to use all prereleases or all nightlies, as opposed to just the relevant ones for the PR, then what @scpeters recommended is much easier.

With either of the approaches, I'd suggest we create some sort of merge protection rule to prevent accidental merging while these files are present. One way would be to create a github action job that fails if any of these files are present and making that a required job for merge.

scpeters commented 1 year ago

If it's safe to use all prereleases or all nightlies, as opposed to just the relevant ones for the PR, then what @scpeters recommended is much easier.

we don't currently have a mechanism to specify which dependencies should be installed from stable / prerelease / nightly. For a given project, you are just able to select which sources on packages.osrfoundation.org it can install from. The gzdev plugins/config/repository.yaml file is a centralized collection of configurations for different packages, and the GZDEV_USE_* files would be a distributed approach, but with the same limitations.

scpeters commented 1 year ago

With either of the approaches, I'd suggest we create some sort of merge protection rule to prevent accidental merging while these files are present. One way would be to create a github action job that fails if any of these files are present and making that a required job for merge.

this is a good idea

scpeters commented 1 year ago

initial prototype in https://github.com/gazebo-tooling/action-gz-ci/pull/65

j-rivero commented 1 year ago

Elaborating a bit more on the general context of the proposed feature:

A more complicated idea to add to the option of adding "overlays" configuration yaml or having custom files in some expected places could be to tell to gzdev that a given version of a dependency is needed (or parse CMakeLists.txt for them):

projects:
    - name: sdformat12
      depends:
         - debname: libignition-math7-dev
           version: 7.1.0

and leave the tool to detect with repo is needed. I don't think that we want this since the control of dependencies in the stable repository is a highest goal probably so we would require explicit repository control.