Update bin/OPL_releases/release.sh due to GitHub change in authentication method for API calls + test ARCHIVE_FORMATS before doing real work#1466
Conversation
access_token as a query parameter is deprecated. See: https://developer.github.com/changes/2019-11-05-deprecated-passwords-and-authorizations-api/ Instead use the Authorization HTTP header instead. Changes were made in the same manner as in gap-system/ReleaseTools@f8ce1aa#diff-a4d451ec23463726f72c43d64c710968f6b602cd653b4de8adee1b556240a829 on which @heiderich based the code. Also move the test of the ARCHIVE_FORMATS environment variable, so when it is necessary to abort, it is done very early on the process (in particular before running OPL-update).
|
Note: The See the discussion in #959 @pstaabp - Could you confirm that webwork2 does not make any use of the three additional JSON files generated by |
|
The thread at #1118 discussed the outdated metadata being used, and I added manual instructions to update inside a running Docker container. If possible, we should make a release in the main OPL repository, and update the |
|
@taniwallach: It would be nice to get this into this release. Most important is to stop using @taniwallach's personal fork of the OPL, and get releases into a more appropriate location. |
1 similar comment
|
@taniwallach: It would be nice to get this into this release. Most important is to stop using @taniwallach's personal fork of the OPL, and get releases into a more appropriate location. |
|
Is this similar metadata fetching that we just approved in #1657? |
|
Yes, this is related to that. Basically, this script that is updated here is obsolete now with #1657. |
|
Should we remove the script then? I was going to add that there is a short subroutine to calls python to do some JSON parsing, which seems overkill to require another language especially since perl is plenty happy parsing JSON. |
|
Yeah, I almost deleted the script in #1657. I don't see any real reason to keep it around. Docker still uses the Makefile in that directory though. Docker should be updated to using the bin/download-OPL-metadata-release.pl script, but that script may need a bit of modification to work with the way that Docker does things in docker-entrypoint.sh. |
|
Since the OPL now has a GitHub action to create the metadata releases, the whole approach of how they were manually created is outdated. I would say that this script and related things should be removed. As @drgrice1 wrote - there is a need to change the |
|
@taniwallach: Actually things have changed even further since I made that comment. Probably we will want to switch to just running OPL-update. However, the OPL-update script will probably no longer work directly the docker-entrypoint.sh script, and will probably need to be fixed for that. The problem is that now the OPL-update also uploads local OPL statistics, and that requires user input. See #1693. Most likely the script is going to need an optional command line flag to skip that step. |
Thanks. I think #1722 should work. I used an environment variable to bypass the upload, as that was faster for me to do. |
|
Yeah, I actually thought about it later and was thinking that an environment variable would be better than a command line flag. The point here is to have a bypass method that is somewhat obscure and unadvertised, as we want admin's running this from command line to upload statistics. That was @drdrew42's point with the current setup. |
I just made use of
bin/OPL_releases/release.shto create updated OPL metadata files, which are at https://github.com/taniwallach/webwork-open-problem-library/releases/tag/2021-08-03GitHub reported by email that the script is using a deprecated approach to make use of the access token:
This PR change the manner in which the token in sent to GitHub, as using to use the Authorization HTTP header instead of the
access_tokenquery parameter which was deprecated. See: https://developer.github.com/changes/2019-11-05-deprecated-passwords-and-authorizations-api/The changes were made in the same manner as in gap-system/ReleaseTools@f8ce1aa#diff-a4d451ec23463726f72c43d64c710968f6b602cd653b4de8adee1b556240a829 on which @heiderich based the code.
I also moved the test of the
ARCHIVE_FORMATSenvironment variable, so when it is necessary to abort, it is done very early on the process (in particular before runningOPL-update). Otherwise, someone who forgets to set it would need to either rerun the script, which would invoke theOPL-updateagain, which is very time-consuming, or "hack" around that.Process to make a release:
bashinside the running Docker container:docker container exec -it webwork2_app_1 bashpythonworks, and if necessary fix it (or install python)python --versionln -s /usr/bin/python3 /usr/bin/pythonbin/OPL_releases/release.shon the last line. You need to provide values formy-tag-namemy_github_usermy-secret-token