devcontainers-contrib / features

🐳 Extra add-in features for Devcontainers and GitHub Codespaces
MIT License
240 stars 126 forks source link

[Bug]: version not respected in mkdocs feature #524

Open agyss opened 1 year ago

agyss commented 1 year ago

Feature id and version

ghcr.io/devcontainers-contrib/features/mkdocs:2

Devcontainer base Image

mcr.microsoft.com/vscode/devcontainers/base:ubuntu-22.04

What happened?

The devcontainer as specified below does not respect the version for mkdocs:

{
    "name": "install version 1.4.3 of mkdocs",
    "image": "mcr.microsoft.com/vscode/devcontainers/base:ubuntu-22.04",
    "features": {
        "ghcr.io/devcontainers-contrib/features/mkdocs:2": {
            "version": "1.4.3"
        }
    }
}

Instead, the latest version is installed: image

Relevant log output

No response

danielbraun89 commented 1 year ago

The mkdocs version is getting bumped because of the mkdocs-material requirement

mkdocs-material is currently being injected by default. in order to select an older version you can clear the "plugins" input like so

    "name": "install version 1.4.3 of mkdocs",
    "image": "mcr.microsoft.com/vscode/devcontainers/base:ubuntu-22.04",
    "features": {
        "ghcr.io/devcontainers-contrib/features/mkdocs:2": {
            "version": "1.4.3",
            "plugins": "",
        }
    }
} 

I understand this behavior is not optimal. Had I knew mkdocs-materialhas such a strict mkdocs version requirement I would have not included it as a default injection. As it stands currently removing mkdocs-material as a default injection will probably break environments of people who rely on its existence, forcing a major feature version bump. @agyss What are your thoughts? Should material remain a default injection or not?

agyss commented 11 months ago

It's quite unlucky that mkdocs-material enforces the versioning of the application it is used with - that's like enforcing an OS update by an application. As it's so commonly used, I would suggest raising an issue at the mkdocs-material repo to remove the enforced mkdocs version in the requirements and rather check the available version by other means. If the version of mkdocs does not fulfill the requirements, they may throw an error or similar.

If they don't agree, I guess we have no other option than to remove it from the default injections, as it completely overwrites an explizit configuration statement and this is IMHO too big an issue.