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

desire to have a way to list relevant (changed) features #197

Open
jcbhmr opened this issue Aug 17, 2023 · 2 comments
Open

desire to have a way to list relevant (changed) features #197

jcbhmr opened this issue Aug 17, 2023 · 2 comments

Comments

@jcbhmr
Copy link

jcbhmr commented Aug 17, 2023

idk if this is the right spot to bring this up but hey 🤷‍♀️

I've recently found immense usefulness in being able to list which features changed and default to all of them if the changes cant be determined https://github.com/devcontainers-community/list-features (no its not very polished yet)

i notice that there seems to be an attempt to do this in the feature-starter repo:

   strategy:
      matrix:
        features: # 👈
          - color
          - hello
        baseImage:
          - debian:latest
          - ubuntu:latest
          - mcr.microsoft.com/devcontainers/base:ubuntu

I think it's very nice to be able to do this instead:

  list-features:
    outputs:
      relevant-features: ${{ steps.list-features.outputs.relevant-features }}
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v3
        with:
          fetch-depth: 0
      - id: list-features
        uses: devcontainers-community/list-features@v2


    strategy:
      fail-fast: false
      matrix:
        include: ${{ fromJSON(needs.list-features.outputs.relevant-features) }}

# then do this
${{ matrix.id }} ${{ matrix.documentationURL }}

or this if you prefer to matrix your image too (disclaimer haven't tested this flow yet)

    strategy:
      fail-fast: false
      matrix:
        feature: ${{ fromJSON(needs.list-features.outputs.relevant-features) }}
        image:
          - debian:latest
          - ubuntu:latest
          - mcr.microsoft.com/devcontainers/base:ubuntu

# then do this
${{ matrix.feature.id }} ${{ matrix.image }} ${{ matrix.feature.documentationURL }}

used in a repo like this
https://github.com/devcontainers-community/npm-features/blob/main/.github/workflows/test-features.yml

demo of it in action
https://github.com/devcontainers-community/npm-features
ex: image

id to see this thing into the official @devcontainers feaeture-starter or organization if that's possible. idk if this is completely breaking some kind of unspoken project ettiqute; i just want this thing to be "official" since it seems so cool.

@jcbhmr jcbhmr changed the title desire to transfer devcontainers-community/list-features to devcontainers desire to have a way to list relevant (changed) features Aug 17, 2023
@samruddhikhandale
Copy link
Member

Hi 👋

I didn't realize that the features-starter repos's test.yaml executes tests for all Features (instead of running test for the modified Feature code)

The Feature's repo has been using dorny/paths-filter@v2 for finding the list of changed Features. See https://github.com/devcontainers/features/blob/main/.github/workflows/test-pr.yaml#L11. I agree, that it needs to add the filters field, which does adds some maintenance to it.

I think we avoided adding dorny/paths-filter@v2 to the Features-starter repo as it's a Template repo and folks would or would not be comfortable with using dorny/paths-filter@v2. (// cc @joshspicer feel free to correct my understanding)

@jcbhmr Looks like you are trying to suggest that we use https://github.com/devcontainers-community/list-features in the features-starter repo? Let me know if my understanding is correct.

@jcbhmr
Copy link
Author

jcbhmr commented Aug 18, 2023

@jcbhmr Looks like you are trying to suggest that we use devcontainers-community/list-features in the features-starter repo? Let me know if my understanding is correct.

yeah that's pretty much it! 👍

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

No branches or pull requests

2 participants