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

Error using dependsOn in a feature #205

Open
rynowak opened this issue Dec 12, 2023 · 2 comments
Open

Error using dependsOn in a feature #205

rynowak opened this issue Dec 12, 2023 · 2 comments

Comments

@rynowak
Copy link

rynowak commented Dec 12, 2023

Summary

We're building a devcontainer feature that includes a dependsOn another feature. This is causing failures using @devcontainers/action but seems to work with the devcontainers CLI.

The documentation says that dependsOn is a preview feature. Is there something I need to do to opt-in to preview features?

Our feature definition is here: https://github.com/radius-project/radius/blob/ae9d95267ce52193ef3cab6ae121faf43dea5a8f/deploy/devcontainer-feature/src/radcli/devcontainer-feature.json

Successful output with CLI

I'm able to successfully package the feature with the CLI.

❯ devcontainer features package deploy/devcontainer-feature/src --output-folder ../../../testing -f
[550 ms] @devcontainers/cli 0.54.2. Node.js v21.3.0. darwin 23.1.0 arm64.
[550 ms] Packaging feature collection...
[551 ms] Processing feature: radcli...
[562 ms] Packaged 1 features!

Failing with actions

The failing workflow is here: https://github.com/radius-project/radius/actions/runs/7183715348/workflow

Here's an example run: https://github.com/radius-project/radius/actions/runs/7183715348/job/19563129086

Output:

Run devcontainers/action@v1
  with:
    publish-features: true
    base-path-to-features: ./deploy/devcontainer-feature/src
    generate-docs: false
    disable-schema-validation: false
    validate-only: false
    disable-repo-tagging: false
    publish-templates: false
  env:
    GITHUB_TOKEN: ***
Validating Feature metadata...
strict mode: use allowUnionTypes to allow union type keyword at "#/properties/onCreateCommand" (strictTypes)
strict mode: use allowUnionTypes to allow union type keyword at "#/properties/onCreateCommand/additionalProperties" (strictTypes)
strict mode: use allowUnionTypes to allow union type keyword at "#/properties/updateContentCommand" (strictTypes)
strict mode: use allowUnionTypes to allow union type keyword at "#/properties/updateContentCommand/additionalProperties" (strictTypes)
strict mode: use allowUnionTypes to allow union type keyword at "#/properties/postCreateCommand" (strictTypes)
strict mode: use allowUnionTypes to allow union type keyword at "#/properties/postCreateCommand/additionalProperties" (strictTypes)
strict mode: use allowUnionTypes to allow union type keyword at "#/properties/postStartCommand" (strictTypes)
strict mode: use allowUnionTypes to allow union type keyword at "#/properties/postStartCommand/additionalProperties" (strictTypes)
strict mode: use allowUnionTypes to allow union type keyword at "#/properties/postAttachCommand" (strictTypes)
strict mode: use allowUnionTypes to allow union type keyword at "#/properties/postAttachCommand/additionalProperties" (strictTypes)
Error: (!) ERR: 'deploy/devcontainer-feature/src/radcli/devcontainer-feature.json' is not valid:
[
    {
        "instancePath": "",
        "schemaPath": "#/additionalProperties",
        "keyword": "additionalProperties",
        "params": {
            "additionalProperty": "dependsOn"
        },
        "message": "must NOT have additional properties"
    },
    {
        "instancePath": "",
        "schemaPath": "#/oneOf",
        "keyword": "oneOf",
        "params": {
            "passingSchemas": null
        },
        "message": "must match exactly one schema in oneOf"
    }
]
@rynowak
Copy link
Author

rynowak commented Dec 12, 2023

As a suggestion, it would be really helpful if the action would print the CLI version that's being used, and the CLI command that's being run. This way I could do the investigation outside of a pipeline.

@joshspicer
Copy link
Member

Apologies, looks like I missed adding dependsOn to the schema, which is validated against in the action for convenience.

I'll make sure to add it to the schema, which will solve this issue. In the meantime, you can turn off the schema validation temporarily with the disable-schema-validation option.

print the CLI version that's being used

Thanks for the feedback, i'm surprised the output doesn't have the version in it today. As an FYI, the action will dynamically fetch the latest published CLI each time, unless you override 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