Skip to content

fix(maven): let a repository with an empty entry take a type - #45

Merged
TheMeinerLP merged 3 commits into
mainfrom
fix/typed-repository-blank-entries
Oct 17, 2026
Merged

TheMeinerLP merged 3 commits into
mainfrom
fix/typed-repository-blank-entries

Conversation

@TheMeinerLP

Copy link
Copy Markdown

Description

A typed GROUP or PROXY that still listed an empty mirrored entry could not be saved. The dashboard showed Not saved: Maven. java.lang.IllegalArgumentException: Invalid maven settings: repository 'onelitefeather': type GROUP has an empty proxied reference. A blank entry names no repository, and the server already ignores it for untyped repositories, so it should not block a type.

What changes:

  • Backend, maven: typed repositories drop blank proxied references (empty, whitespace, or only a trailing slash) before the rules are checked, and store the cleaned list. Untyped repositories are not rewritten. All other typed rules are unchanged.
  • Backend, settings: a settings update that breaks a rule is answered with 400 and the rule itself as the message, for every settings domain. The message no longer contains the Java exception class name.
  • Frontend: switching a repository to a typed group or proxy removes its blank entries from the form and names them in the confirmation ("1 empty entry will be removed."). Blank entries are no longer reported as violations of the type. The error banner drops a leading Java exception class name from the message.

Three commits, one type each: fix(maven), fix(settings), fix(ui).

Type of change

  • fix - bug fix
  • feat - new feature
  • refactor - internal change without behaviour change
  • perf - performance improvement
  • docs - documentation only
  • test - tests only
  • build / ci / chore - tooling, dependencies, pipelines
  • Breaking change (configuration, API or behaviour that existing deployments rely on)

How was this tested?

  • ./gradlew :reposilite-backend:test --tests 'com.reposilite.maven.application.RepositoryTypeSettingsTest' --tests 'com.reposilite.configuration.shared.DefaultSharedSettingsReferenceTest': all pass (30 and 3 tests).
  • ./gradlew :reposilite-backend:integration --tests 'com.reposilite.maven.RepositoryTypesIntegrationTest' --tests 'com.reposilite.configuration.LocalSettingsIntegrationTest' --tests 'com.reposilite.configuration.RemoteSettingsIntegrationTest': all pass (11, 15 and 15 tests). They cover a PUT of a typed GROUP with empty and blank entries that saves and stores the cleaned list, a rejected maven update answered with the exact rule and no java.lang, and a rejected login domain answered with 400 and the rule.
  • npx vitest run on the touched files (repositoryTypes.test.js, EntryDetail.type.test.js, toast.test.js), plus configuration-conflicts.test.js and useLoginSettings.test.js because they assert on the error text: all pass. ESLint is clean on the touched frontend files.
  • Not run: the full ./gradlew build and the full test suites.

Checklist

  • Commit messages follow the Conventional Commits convention documented in CLAUDE.md (English, imperative, one of feat, fix, docs, refactor, test, build, ci, chore, perf)
  • Tests cover the change, or the change is not testable and I explained why above
  • ./gradlew build passes locally (only the touched test classes were run, see above)
  • Documentation and configuration samples are updated if the change is user-facing (no documented behaviour changes; the type help text still holds)
  • Existing copyright headers are preserved; new files carry the appropriate header
  • No credentials, tokens or personal data are included in the diff

A typed GROUP or PROXY that still lists an empty proxied entry was
rejected on save, although the server already ignores blank entries of
untyped repositories. A blank entry names no repository, so typed
repositories now drop blank proxied references before the rules are
checked and store the cleaned list. Untyped repositories are not
rewritten, and every other typed rule is unchanged.
A settings update that broke a rule was answered with the toString of
the internal exception, so the dashboard showed a Java class name in
front of the rule. The rejection now carries the rules as a list, and
the 400 response uses the message of that failure: the rules as
written, without a class name or a prefix. The check runs for every
settings domain, because they all share the same update path.
Switching a repository to a typed group or proxy kept its empty mirrored
entries, and the save then failed on them. The switch now drops the
blank entries from the form and names them in its confirmation ("1
empty entry will be removed."), with the same confirm flow as the other
removals. Blank entries no longer count as violations of the type,
because the server drops them. The error banner shows the message of a
failure without the Java exception class name in front of it.
@github-actions

Copy link
Copy Markdown

Test results

  260 files    260 suites   56m 11s ⏱️
2 350 tests 2 349 ✅ 1 💤 0 ❌
2 416 runs  2 415 ✅ 1 💤 0 ❌

Results for commit ff5c082.

@TheMeinerLP
TheMeinerLP merged commit 00ee5ab into main Oct 17, 2026
8 checks passed
@TheMeinerLP
TheMeinerLP deleted the fix/typed-repository-blank-entries branch October 17, 2026 16:45
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.

1 participant