Skip to content

Conversation

meisterT
Copy link
Member

@meisterT meisterT commented Sep 5, 2024

No description provided.

eldering and others added 13 commits August 25, 2024 10:12
Also point to the legacy ICPC version for now. A new version is
planned to be released in September around the ICPC World Finals
in Astana, but until that's finalized, point to what we're actually
(roughly) implementing currently.
In other places, the logs are nicely base64 encoded and the twig
template applies a base64 decoding
(`webapp/templates/jury/internal_error.html.twig`) to render the
judgehost logs. This seems to be missed on this place.

Fixes issue #2456.
The wrong state was picked in the past, PHPStan found this in an unrelated other issue.
Debian testing started using different quotes in the generated configure
scripts.

Co-authored-by: Tobias Werth <[email protected]>
I find it easier to follow when all the composer commands are in the
same Makefile.

Also move `composer auto-scripts` back into inplace-install-l, out of
concern for ordering issues. It was moved into a prereq of
inplace-install in commit ab267ec (Put lib/vendor close to the
webapp, 2024-06-23).
Just moving around the lines, no functional changes.
Checked all remaining foreign keys using:
```
SELECT
    rc.DELETE_RULE, rc.UPDATE_RULE,
    kcu.TABLE_NAME, kcu.COLUMN_NAME, kcu.CONSTRAINT_NAME, kcu.REFERENCED_TABLE_NAME, kcu.REFERENCED_COLUMN_NAME
FROM
  INFORMATION_SCHEMA.KEY_COLUMN_USAGE kcu
INNER JOIN information_schema.REFERENTIAL_CONSTRAINTS AS rc ON kcu.CONSTRAINT_NAME = rc.CONSTRAINT_NAME
WHERE
  kcu.REFERENCED_TABLE_SCHEMA = 'domjudge'
  AND DELETE_RULE = 'RESTRICT';
```

After some discussion with Jaap it was decided to set columns referring
to judgedaemons to null instead of cascading the delete. A single
foreign key's delete rule is kept as 'restrict' since that case looks to
be sensible.

Fixes #2464, #2465.
The old foreign key was set to cascade, deleting the entire submission
when a user got deleted. This feels conceptually wrong since a
submission is connected to a team and not to a user. The user of the
team of the submission is more 'metadata' than anything else.
Extract the OS/release information

This is not 100% doable with /etc/os-release only. The Debian difference
between Release & Codename is not shown in the official containers for
example. See: https://hub.docker.com/_/debian
Previously, there were two scenarios that are problematic:
- while handling an error, we start writing the meta file, and if that
  also fails, we treat this as handling a new error and never stop;
- while writing the meta file, we encounter an error which in turn tries
  writing to the meta file causing another error and we never stop.
Even if we cannot match anything we would have had an array containing an empty array. That array indicates that nothing was matched.

We should now fail when:
- preg_match_all fails
- preg_match_all returns it found 0 matches
- the redundant case (as safeguard) when the array has 0 matches
@meisterT meisterT merged commit 4dcbb95 into wfastana Sep 5, 2024
52 checks passed
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.

7 participants