cypress-io / cypress-docker-images

Docker images with Cypress dependencies and browsers
https://on.cypress.io/continuous-integration
MIT License
1.03k stars 380 forks source link

Support dependabot updates of docker images referencing cypress-docker-images #1250

Open anscfrisson opened 3 days ago

anscfrisson commented 3 days ago

I have configured dependabot updates of cypress-docker-images in a private repository:

Dependabot runs include:

From https://docs.github.com/en/code-security/dependabot/dependabot-version-updates/configuration-options-for-the-dependabot.yml-file#docker

In order for Dependabot to fetch Docker metadata, maintainers of Docker images must add the org.opencontainers.image.source label to their Dockerfile, and include the URL of the source repository. Additionally, maintainers must tag the repository with the same tags as the published Docker images. For an example, see the dependabot-fixtures/docker-with-source repository. For more information on Docker labels, see Extension image labels and BUILDX_GIT_LABELS in the Docker documentation.

Would it be possible to support dependabot updates of cypress-docker-images, by, as in dependabot-fixtures/docker-with-source, 1) adding org.opencontainers.image.source labels to Dockerfiles and 2) tagging the repository with the same tags as the published Docker images?

MikeMcC399 commented 2 days ago

@anscfrisson

Would it be possible to support dependabot updates of cypress-docker-images, by, as in dependabot-fixtures/docker-with-source, 1) adding org.opencontainers.image.source labels to Dockerfiles and 2) tagging the repository with the same tags as the published Docker images?

For Cypress Docker images to support GitHub Dependabot version updates would require a re-design of the whole Cypress Docker image creation and publication process as far as I can see.

1) adding org.opencontainers.image.source labels to Dockerfiles

Cypress Docker images do not have a 1:1 relationship to a specific Dockerfile.

2) tagging the repository with the same tags as the published Docker images?

Reading the Dependabot documentation it seems that tags would need to be semver compliant and I assume it would mean creating separate GitHub repos to correspond to each of the Docker Hub repos factory, base, browsers and included, which are currently fed from this one GitHub repo.

anscfrisson commented 1 day ago

Thanks @MikeMcC399 for the update!

I understand that supporting dependabot for cypress-docker-images might then not be planned soon as it requires a re-design?

Would there be other opportunities from the list of dependabot package-ecosystem to auto-update browsers supported by cypress?

For instance:

Then to fetch browsers there are options:

MikeMcC399 commented 1 day ago

@anscfrisson

I understand that supporting dependabot for cypress-docker-images might then not be planned soon as it requires a re-design?

You can assume that there are no major enhancements planned unless the Cypress.io team announces them.

Would there be other opportunities from the list of dependabot package-ecosystem to auto-update browsers supported by cypress?

I don't see any simple way to use Dependabot. If you are not tied to Dependabot, you may want to look at https://docs.renovatebot.com/docker/ which is able to update cypress/factory, cypress/base and cypress/included (short-form tag only) as these tags use semver formats.

MikeMcC399 commented 23 hours ago

It would be possible to extend this scheme also to cypress/browsers. This would be similar to the way that CircleCI handles tagging. I will submit a separate enhancement request to describe this so that it could be used with Renovate.

anscfrisson commented 23 hours ago

Thanks @MikeMcC399 for the tip, I'll look into renovatebot, and for the opportunity to extends its support to cypress/browsers.

MikeMcC399 commented 10 hours ago

@anscfrisson

It seems I was too optimistic in thinking that the Renovate Docker implementation would help in GitHub Actions. Reading the docs, GitHub Actions aren't listed. CircleCI is listed however, so it would have some benefit.