Skip to content

Conversation

vmcj
Copy link
Member

@vmcj vmcj commented Aug 23, 2025

Discussed during the NWERC hackathon in 2023.

We allow admins to toggle an autoquery to domjudge.org for 2 reasons:

  • Alerting users that a new version might exist, helping us in case of security releases.
  • Giving a gentle nudge for people to upgrade making support easier.
  • Getting some information on what installations are out there.

Default this doesn't happen, so the admin chooses to enable this themselves so this is different from normal telemetry.

@vmcj vmcj force-pushed the check_version branch 2 times, most recently from 18e58bb to 378db01 Compare August 23, 2025 11:25
@vmcj vmcj force-pushed the check_version branch 2 times, most recently from f2a225c to de80c58 Compare August 25, 2025 08:56
preg_match("/\d.\d.\d/", $this->domjudgeVersion, $matches);
$extractedLocalVersionString = $matches[0];
if ($this->config->get('check_new_version', false) === UpdateStrategy::Strategy_incremental) {
/* Steer towards the nearest new patch release first
Copy link
Member

Choose a reason for hiding this comment

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

I might be alone with this opinion, but I think we should tell users the most recent version instead.

Feel free to close

Copy link
Member Author

Choose a reason for hiding this comment

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

I've now added both strategies.

I can see a case for both strategies if we do enough of the work (and had the code already for both),

We should discuss this in person though as to me doing the patch releases is that extra time which I don't think we invest often enough. We change quite a lot between versions and we seem to forget to backport often so the patch releases are often very outdated to maintain and not often useful because the fixes are not being backported (and therefor a sort of false promise).

Copy link
Contributor

Choose a reason for hiding this comment

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

I think that having both strategies is nice, if we actually do the bugfix backports. If we do not plan to more actively do these, then I agree that we should guide users towards the latest version.

Copy link
Member

Choose a reason for hiding this comment

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

I think we should do backports/releases more indeed and I think offering both patch and major/minor release updates makes sense. Why can't we display both at the same time?

Copy link
Member

Choose a reason for hiding this comment

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

Have we people asking for backport releases? They are a lot of work and I'm not sure whether it's worth the effort

'doc_links' => $this->dj->getDocLinks(),
'allow_registration' => $selfRegistrationCategoriesCount !== 0,
'enable_ranking' => $this->config->get('enable_ranking'),
'new_version_available' => $this->dj->checkNewVersion(),
Copy link
Contributor

Choose a reason for hiding this comment

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

From what I see and tried, this will make a HTTP request to versions.domjudge.org on every page load. This seems very aggressive, and might even cause an accidental DDOS of our server when large contests are running. Should we store it with some cache time in the DB?

Copy link
Member Author

Choose a reason for hiding this comment

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

Given where the server is running I doubt if that ever happens but we can handle that case. I don't prefer to store this in the database but we can use this:
https://symfony.com/doc/current/components/cache.html

Copy link
Member

Choose a reason for hiding this comment

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

Alternatively just do it on the index page?

/**
* @return String[]|false
*/
public function cacher_checkNewVersion(ItemInterface $item): array|false {
Copy link
Member Author

Choose a reason for hiding this comment

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

I'll rename this one.

Copy link
Contributor

@Kevinjil Kevinjil left a comment

Choose a reason for hiding this comment

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

Caching seems to work as expected, thanks!

@Kevinjil Kevinjil added this to the 9.0 milestone Sep 25, 2025
vmcj and others added 2 commits September 25, 2025 21:25
Store optional installation method for install metrics, we can use this to see
what to focus efforts on.
Discussed during the hackathon in 2023. We allow admins to toggle an
autoquery to domjudge.org for 2 reasons:
- Alerting users that a new version might exist, helping us in case of
  security releases.
- Giving a gentle nudge for people to upgrade making support easier.
- Getting some information on what installations are out there.

Co-authored-by: Tobias Werth <[email protected]>
@vmcj vmcj enabled auto-merge September 25, 2025 19:45
@vmcj vmcj added this pull request to the merge queue Sep 25, 2025
Merged via the queue into DOMjudge:main with commit 5f3b2bd Sep 25, 2025
36 checks passed
@vmcj vmcj deleted the check_version branch September 25, 2025 20:24
@meisterT
Copy link
Member

I think this was merged prematurely, as https://versions.domjudge.org doesn't exist yet.

@vmcj
Copy link
Member Author

vmcj commented Sep 28, 2025

I think this was merged prematurely, as https://versions.domjudge.org doesn't exist yet.

When the site is not reachable it should just do nothing. So if you get problems in your local copy something is wrong.

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