Skip to content

Store the sources of resolutions#4643

Merged
mnonnenmacher merged 5 commits intomainfrom
resolution-sources
Mar 12, 2026
Merged

Store the sources of resolutions#4643
mnonnenmacher merged 5 commits intomainfrom
resolution-sources

Conversation

@mnonnenmacher
Copy link
Contributor

@mnonnenmacher mnonnenmacher commented Mar 9, 2026

Store from which source resolutions are originating (global configuration file, repository configuration file, or the server). This is mainly required for the UI later on to decide which resolutions are editable. See the commit messages for details.

@mnonnenmacher mnonnenmacher force-pushed the resolution-sources branch 2 times, most recently from abfcefc to 693681f Compare March 10, 2026 12:50
@mnonnenmacher mnonnenmacher marked this pull request as ready for review March 10, 2026 12:55
REPOSITORY,

/** The resolution is managed by the server. */
SERVER
Copy link
Contributor

Choose a reason for hiding this comment

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

I assume, this refers to resolutions that have been created via the UI, right? The name SERVER does not seem to fit, also the comment "...managed by the server". I have, however, no better idea either.

Also, REPOSITORY might be a bit misleading, since it refers only to the configuration file for this repository and not the structure in the hierarchy.

Copy link
Contributor

Choose a reason for hiding this comment

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

Maybe we can clarify all of these enum names a bit, like: GLOBAL_FILE, REPOSITORY_FILE, SERVER_UI. Instead of the "_FILE" suffix maybe also "_CONFIG" could be used.

And BTW, I do not think that a "_UI" suffix would be misleading here, just because resolutions could also be sent via curl to the API directly, because this should more indicate how that type of resolution is supposed to be managed, so I believe saying "it's supposed to be managed via the UI" is fine.

Copy link
Contributor Author

@mnonnenmacher mnonnenmacher Mar 11, 2026

Choose a reason for hiding this comment

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

I don't want to do the refactoring before we agree on the names, so what about these:

  • GLOBAL_FILE
  • REPOSITORY_FILE
  • SERVER_REPOSITORY: This is precise because these resolutions are associated to a specific repository. It is also future proof in case we ever want to create resolutions also on a different hierarchy level (which could make sense for issue resolutions).

Copy link
Contributor

Choose a reason for hiding this comment

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

I'm not sure about SERVER_REPOSITORY in the context of #2938; I'd rather not refer to a "repository" here. It's also misleading as it sounds as if the resolution would still somehow be stored in the Git repository along with the source code. If at all, maybe say SERVER_REPOSITORY_LEVEL.

Copy link
Contributor

Choose a reason for hiding this comment

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

I agree, _REPOSITORY would be misleading, but let's not invent any monster names, either... 😏

Why can't we just use SERVER?

Copy link
Contributor

Choose a reason for hiding this comment

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

Still not really happy with SERVER, but as I have no better idea, I do not object.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@sschuberth @Etsija None of you has made a change request, so do you insist on changing the names or not?

Copy link
Contributor

@Etsija Etsija Mar 12, 2026

Choose a reason for hiding this comment

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

I have no objections to the original ones, but if @sschuberth wants to, I'm also OK with GLOBAL_FILE, REPOSITORY_FILE, and SERVER.

Copy link
Contributor

Choose a reason for hiding this comment

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

I somewhat do insist on having the "_FILE" suffixes at least. Let's briefly discuss in the daily.

Copy link
Contributor

@sschuberth sschuberth Mar 12, 2026

Choose a reason for hiding this comment

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

We decided to go with GLOBAL_FILE, REPOSITORY_FILE, and SERVER (for now).

@oheger-bosch
Copy link
Contributor

From my PoV, the changes are fine.

Create an `OrtServerResolutionProvider` to prepare for storing the
source of resolutions.

Signed-off-by: Martin Nonnenmacher <martin.nonnenmacher@doubleopen.org>
Change all workers to use the new provider and remove the now unused
helper functions.

Signed-off-by: Martin Nonnenmacher <martin.nonnenmacher@doubleopen.org>
Extend the three resolution types with a new `source` property which
stores where the resolution is coming from. This commit is applying the
required model and database schema changes, the following commits will
implement storing the correct source for each resolution.

For resolutions already stored in the database, the source
`REPOSITORY_FILE` is chosen which represents the repository
configuration file, as this is most likely correct for the majority of
past resolutions. This avoids introducing an `UNKNOWN` source only for
historic reasons which will never be used in the future.

Signed-off-by: Martin Nonnenmacher <martin.nonnenmacher@doubleopen.org>
Move the `resolveResolutionsWithMappings` helper function to the
`OrtServerResolutionProvider` to prepare for setting the correct sources
for resolutions.

Signed-off-by: Martin Nonnenmacher <martin.nonnenmacher@doubleopen.org>
Signed-off-by: Martin Nonnenmacher <martin.nonnenmacher@doubleopen.org>
@Etsija
Copy link
Contributor

Etsija commented Mar 12, 2026

Looks good from my part. UI Docker build fails, however.

@mnonnenmacher
Copy link
Contributor Author

Looks good from my part. UI Docker build fails, however.

Yes, there are issues with repo.eclipse.org currently:
https://www.eclipsestatus.io/

@mnonnenmacher mnonnenmacher added this pull request to the merge queue Mar 12, 2026
Merged via the queue into main with commit 95ba6cf Mar 12, 2026
44 of 154 checks passed
@mnonnenmacher mnonnenmacher deleted the resolution-sources branch March 12, 2026 14:54
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.

4 participants