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

Updates "outdated" command to display stale image versions #768

Open
wants to merge 21 commits into
base: main
Choose a base branch
from

Conversation

samruddhikhandale
Copy link
Member

@samruddhikhandale samruddhikhandale commented Mar 1, 2024

Recently, we integrated Dependabot and Dev Containers where we get PRs to update versions for stale Features.

Similarly, for the devcontainer/images, we have been worried of bumping a major version of an image because folks could be left behind on stale images (which doesn't receive security patches). Currently, we don't have a good way of alerting the community when a new image version becomes available (besides putting up notices and announcing in the community channels). Out of public repos, 2600 dev containers are using the stale mcr.microsoft.com/devcontainers/python image (older major version which ww don’t support).

Hence, this PR updates the outdated command to include the stale image versions. It looks for the .devcontainer.json file, and looks for corresponding images in .devcontainer.json, Dockerfiles or Compose files (based on the dev container structure)

The outdated command currently supports only the images hosted from https://github.com/devcontainers/images. Reasoning: I looked at some popular images (eg. python, node, go, php etc), however, they don’t use semantic versioning. Hence, doesn’t make sense to implement for them.

Example - Image pinned to semver

image image

Example - Image pinned to major and major.minor

image image

@samruddhikhandale samruddhikhandale marked this pull request as ready for review March 6, 2024 19:56
@samruddhikhandale samruddhikhandale requested a review from a team as a code owner March 6, 2024 19:56
Copy link
Contributor

@chrmarti chrmarti left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This will be a great addition! Left a few comments.

src/spec-node/dockerfileUtils.ts Outdated Show resolved Hide resolved
src/spec-node/collectionCommonUtils/outdatedCommandImpl.ts Outdated Show resolved Hide resolved
@cklim2024
Copy link

__dolve

Copy link
Contributor

@chrmarti chrmarti left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good! Left a comment for a small correction, approving now.

const wantedVersion = latestVersion.split('.').slice(0, version.split('.').length).join('.');
const wantedTag = tagSuffix ? `${wantedVersion}-${tagSuffix}` : wantedVersion;
const latestVersion = latestSemVersion.split('.').slice(0, version.split('.').length).join('.');
const wantedTag = tagSuffix ? `${latestVersion}-${tagSuffix}` : latestVersion;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: Should this be latestTag?

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Update

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

Successfully merging this pull request may close these issues.

5 participants