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

[Feature Request] Options to use colcon user configuration override #97

Open
seanyen opened this issue Feb 26, 2020 · 4 comments
Open
Labels
enhancement New feature or request help wanted Extra attention is needed

Comments

@seanyen
Copy link
Contributor

seanyen commented Feb 26, 2020

Description

As of this writing, action-ros-ci composes and executes colcon tasks in the following order:

  • colcon mixin add default <repo> (optional)
  • colcon build
  • colcon lcov-result --initial
  • colcon test
  • colcon lcov-result

Beyond the common flow, action-ros-ci synthesizes default parameters to some tasks. For example, --event-handlers console_cohesion+ --symlink-install always goes to colcon build. And when it comes to customize the tasks, typically it exposes the options case-by-case, for example, it currently takes extra-cmake-args for developers to customize the --cmake-args for colcon build.

On the other side, colcon has a user configuration concept, where developers can define a YAML file to describe what arguments should go to colcon command by default. For example, if I have the following file defined and specified in %COLCON_DEFAULTS_FILE%,

# defaults.yaml
{
    "build": {
        "symlink-install": true,
        "cmake-args": [
            "-G",
            "Ninja",
            "-DCMAKE_PREFIX_PATH=d:/install",
            "-DCATKIN_SKIP_TESTING=ON",
            "-DCMAKE_BUILD_TYPE=Release"],
        "event-handlers": ["console_cohesion+"],
        "install-base": "d:/install",
        "parallel-workers" : 1,
        "merge-install": true
    }
}

Then, whenever I run colcon build, those arguments will be automatically applied to my build task. This approach gives much more flexible to extend the colcon common flow without maintaining many parameter interfaces.

I am proposing that we can have a built-in defaults.yaml to capture all the good default parameters that we have today. And it exposes a new parameter, for example, colcon-defaults-file which is for developers to override the default settings and to use their customized one. I envision that could be something like:

    - uses: ros-tooling/action-ros-ci@master
      with:
        package-name: abc_package
        colcon-defaults-file: ${{ github.workspace }}/defaults.yaml

Related Issues

#89

@seanyen seanyen added the enhancement New feature or request label Feb 26, 2020
@piraka9011
Copy link

This is a reasonable enhancement.
Some questions:

  • Can this file also be hosted in a gist or should this be local to the repo it's running in only?
  • Would it be better to add this feature to setup-ros-docker and improve that as well?

@seanyen
Copy link
Contributor Author

seanyen commented Feb 27, 2020

  • Can this file also be hosted in a gist or should this be local to the repo it's running in only?

I don't think colcon can take a URL here: https://github.com/colcon/colcon-defaults/blob/78f808ef9705a15a52d00b0adfee342d1390b348/colcon_defaults/argument_parser/defaults.py#L72

But I think developers can add another step before using this action to copy their gist?

  • Would it be better to add this feature to setup-ros-docker and improve that as well?

Interesting. Can you elaborate more on what's the improvement you envision?

@piraka9011
Copy link

I don't think colcon can take a URL here: https://github.com/colcon/colcon-defaults/blob/78f808ef9705a15a52d00b0adfee342d1390b348/colcon_defaults/argument_parser/defaults.py#L72

What I meant is doing something similar to action-ros-ci where we allow users to pass a file or a URL (see this for example).

Interesting. Can you elaborate more on what's the improvement you envision?

Thought you might have some insight as to whether there would have to be a docker specific implementation if we want to add this feature to a docker action.

@seanyen
Copy link
Contributor Author

seanyen commented Feb 28, 2020

What I meant is doing something similar to action-ros-ci where we allow users to pass a file or a URL (see this for example).

Ah sure. That's something doable.

@emersonknapp emersonknapp added enhancement New feature or request help wanted Extra attention is needed and removed enhancement New feature or request labels Mar 6, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

3 participants