Skip to content

Conversation

@PhrozenByte
Copy link
Contributor

Refactor update.sh to better incorporate the new versions.json (see below). The changes are rather minor, they just look like a rewrite due to general code cleanups and moving stuff around. Simply check the commits, you can review all changes on a per-commit-basis. This includes the following changes:

  • fb5c1a2 Increase Bash's error verbosity by running with set -eu -o pipefail (instead of just set -e)
  • dbfffe5 Move the main functionality to the create_variant function
  • f650628 + 5239485 Bake download URL, version, sha256 and GPG key into Dockerfiles
  • 4a5875f Add config variable for PHP version to update.sh
  • 5ee9a9c Add 'DO NOT EDIT' note to generated Dockerfiles
  • 2cb9a62 Some general code cleanup

The main feature of this PR is adding a new versions.json (e68cbb8). versions.json contains information about the latest phpMyAdmin branches (currently just phpMyAdmin 5.2) and container variants available.

It was inspired by PHP's versions.json, but was adapted to better fit phpMyAdmin's needs. The information in versions.json is currently scattered across the repo and often just accessible by humans, e.g. right now it's impossible to reliably determine the latest full version of containerized phpMyAdmin programmatically. The only way is to either fiddle around with sed on the Dockerfile, or to build the container.

versions.json is managed by ./update.sh. There's no need to edit this file manually (even when adding/removing variants and/or versions), just run ./update.sh. See 6d73dc8 for an example.

Changelog was updated accordingly, too (271a3e6).

{
  "5.2": {
    "branch": "5.2",
    "version": "5.2.1",
    "sha256": "373f9599dfbd96d6fe75316d5dad189e68c305f297edf42377db9dd6b41b2557",
    "url": "https://files.phpmyadmin.net/phpMyAdmin/5.2.1/phpMyAdmin-5.2.1-all-languages.tar.xz",
    "ascUrl": "https://files.phpmyadmin.net/phpMyAdmin/5.2.1/phpMyAdmin-5.2.1-all-languages.tar.xz.asc",
    "variants": {
      "apache": {
        "variant": "apache",
        "base": "debian",
        "phpVersion": "8.1"
      },
      "fpm": {
        "variant": "fpm",
        "base": "debian",
        "phpVersion": "8.1"
      },
      "fpm-alpine": {
        "variant": "fpm-alpine",
        "base": "alpine",
        "phpVersion": "8.1"
      }
    }
  }
}

Signed-off-by: Daniel Rudolf <github.com@daniel-rudolf.de>
This commit includes no functional changes besides a new debug info.

Signed-off-by: Daniel Rudolf <github.com@daniel-rudolf.de>
Signed-off-by: Daniel Rudolf <github.com@daniel-rudolf.de>
Signed-off-by: Daniel Rudolf <github.com@daniel-rudolf.de>
Signed-off-by: Daniel Rudolf <github.com@daniel-rudolf.de>
This commit includes no functional changes.

Signed-off-by: Daniel Rudolf <github.com@daniel-rudolf.de>
Signed-off-by: Daniel Rudolf <github.com@daniel-rudolf.de>
'versions.json' contains information about the latest branches (currently phpMyAdmin 5.2 only) and variants. It was inspired by PHP's official Docker image and is managed by `update.sh`. There's no need to edit this file manually, just run `update.sh`.

Signed-off-by: Daniel Rudolf <github.com@daniel-rudolf.de>
Signed-off-by: Daniel Rudolf <github.com@daniel-rudolf.de>
Signed-off-by: Daniel Rudolf <github.com@daniel-rudolf.de>
@PhrozenByte
Copy link
Contributor Author

I don't think that the failing test is related to these changes.

@williamdes williamdes requested a review from ibennetch June 1, 2023 15:34
@williamdes
Copy link
Member

The main feature of this PR is adding a new versions.json (e68cbb8). versions.json contains information about the latest phpMyAdmin branches (currently just phpMyAdmin 5.2) and container variants available.
It was inspired by PHP's versions.json, but was adapted to better fit phpMyAdmin's needs. The information in versions.json is currently scattered across the repo and often just accessible by humans, e.g. right now it's impossible to reliably determine the latest full version of containerized phpMyAdmin programmatically. The only way is to either fiddle around with sed on the Dockerfile, or to build the container.

Can you give us some code to better understand your use case ?
This should be a SBOM into the container layer: https://github.com/sudo-bot/docker-phpldapadmin/blob/53338b9feb0096d593d190e9ab637d8ed503f054/docker/Dockerfile#L62-L100

@PhrozenByte
Copy link
Contributor Author

Can you give us some code to better understand your use case ?
This should be a SBOM into the container layer: https://github.com/sudo-bot/docker-phpldapadmin/blob/53338b9feb0096d593d190e9ab637d8ed503f054/docker/Dockerfile#L62-L100

versions.json contains metadata about the repo, i.e. the available container variants and supported versions, not for use inside the container.

@PhrozenByte
Copy link
Contributor Author

Any updates on this @williamdes @ibennetch?

If you just don't want it, just say so, no need to keep this open then.

If you plan to merge it but want specific changes we've talked about but disagree (like the ENV story above), make a decision and say so, I'll change it then, even when I disagree contentwise, it's your project.

If you need more info (for some more reasoning, see e.g. MariaDB/mariadb-docker#516 (comment)), say so, I'm happy to provide what I can.

@williamdes
Copy link
Member

Any updates on this @williamdes @ibennetch?

If you just don't want it, just say so, no need to keep this open then.

If you plan to merge it but want specific changes we've talked about but disagree (like the ENV story above), make a decision and say so, I'll change it then, even when I disagree contentwise, it's your project.

If you need more info (for some more reasoning, see e.g. MariaDB/mariadb-docker#516 (comment)), say so, I'm happy to provide what I can.

Let's be honest, until now I do not see us wanting the change of the Dockerfile and versions.json
If you agree I can merge this PR and change the pipe to versions.json to /dev/null so it's easy to add back.
And revert the change to the Dockerfiles

You also can do it but with a rebase :)

@PhrozenByte
Copy link
Contributor Author

Let's be honest, until now I do not see us wanting the change of the Dockerfile and versions.json
If you agree I can merge this PR and change the pipe to versions.json to /dev/null so it's easy to add back.

This PR is about adding a versions.json to have some metadata about the repo. Adding it as dead code (like piping it to /dev/null) or requiring a CLI option (even adds the risk of an outdated versions.json) contradicts the purpose, because the required metadata simply isn't there then.

I don't think that investing more work here just to get something merged that is neither used nor wished makes much sense. So I'm closing this now. Thanks for your review.

@williamdes
Copy link
Member

Let's be honest, until now I do not see us wanting the change of the Dockerfile and versions.json
If you agree I can merge this PR and change the pipe to versions.json to /dev/null so it's easy to add back.

This PR is about adding a versions.json to have some metadata about the repo. Adding it as dead code (like piping it to /dev/null) or requiring a CLI option (even adds the risk of an outdated versions.json) contradicts the purpose, because the required metadata simply isn't there then.

I don't think that investing more work here just to get something merged that is neither used nor wished makes much sense. So I'm closing this now. Thanks for your review.

Okay, the other changes to refactor the file where good ones. Do you mind if I pick them ?

@PhrozenByte
Copy link
Contributor Author

Okay, the other changes to refactor the file where good ones. Do you mind if I pick them ?

Sure, go ahead 👍 😃

@williamdes williamdes reopened this Jun 30, 2023
This reverts commit 6d73dc8.
This reverts commit 5d0a2c22adbb918ceb11d84eaddeff0750df759d.
@williamdes williamdes self-assigned this Jun 30, 2023
This reverts commit bc440d32df7d8a2eea760fd85ae81564f7b77be8.
This reverts commit 25b588cca10026c25bb856f6fb8bba2767e7af9a.
This reverts commit f5606d330139fca0dcb6ab97ac4826c5cbed1803.
Copy link
Member

@williamdes williamdes left a comment

Choose a reason for hiding this comment

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

Thank you @PhrozenByte !

Most of your work is kept, I made some reverts in separate commits.
We can still revert the reverts if we change our minds

@williamdes williamdes merged commit 8674356 into phpmyadmin:master Jun 30, 2023
@williamdes
Copy link
Member

williamdes commented Jun 30, 2023

After random searches, I found out that generate-stackbrew-library.sh seems to reference versions.json.
Not sure if it will be required some day

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.

2 participants