Story #16471: Fix cas-server container build and Consul service registration - #3721
Conversation
|
Fixed Issues (221)Great job! The following issues were fixed in this Pull Request
Use @Checkmarx to take action directly from this PR:
Try it: |
7bccff9 to
b962914
Compare
1c67805 to
4f6ab9b
Compare
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Advanced Run ID: 📒 Files selected for processing (3)
Included review availability: Your plan provides up to 1 included review per hour; 0 remain after this review. 📝 WalkthroughWalkthroughThe pull request configures automatic CAS image builds during Maven packaging, disables Consul resolver file backups, and prefixes the Spring application name in the Vitamui container service. ChangesCAS image build
Consul resolver configuration
Vitamui service naming
Priority: ➖ Normal Estimated code review effort: 1 (Trivial) | ~5 minutes Change: Bug fix Suggested reviewers: Merge Risk: ⚪ Minimal · up to The changes are mergeable: local CAS packaging remains unaffected, while image publication is enabled only by the configured container build. 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
Full details: Description checkExplanation The description explains the intended Jib and Consul changes, but it does not follow the repository template. It omits the required sections for change type, documentation, tests, migration, checklist, and contributor. It also conflicts with the changeset because it states that backup: true is retained, while the file changes backup from true to false.
✨ Finishing Touches 💡 1🛠️ Fix failing CI checks 💡
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
…tration Build the cas-server container image with jib, like every api/* module: - Bind jib:build to the package phase in cas/cas-server/pom.xml. Because cas/pom.xml has no <parent>, cas-server inherits nothing from the root pluginManagement, where that binding lives for the other modules. The module keeps jib.skip=true so a local mvn install never pushes; Jenkinsfile.containers overrides it with -Djib.skip=false. - Add <from>gcr.io/distroless/java21</from> so cas-server ships on the same base image as the other services instead of falling back to jib's Jetty default for war packaging. - Add <allowInsecureRegistries>true</allowInsecureRegistries>, required by the HTTP registry push performed by Jenkinsfile.containers (-DsendCredentialsOverHttp=true). - Restrict the extraDirectories path to cas-server.war, instead of copying the whole target/ tree into /app/ (classes, the exploded war, maven-status, generated sources), which embedded the payload several times in the image. Prefix SPRING_APPLICATION_NAME with vitamui- in the container systemd unit template. Every application.yml.j2 declares spring.application.name: vitamui-<component> and derives spring.cloud.consul.discovery.serviceName from it, and vitamui_vars.yml resolves peers as vitamui-<component>.service.<consul_domain>. The environment variable was overriding the yml with the short name, so services started in container mode registered in Consul under the wrong name. Keep backup: true on the /etc/resolv.conf blockinfile in the consul role. It is the only rollback copy of the resolver configuration; without it a bad edit leaves the host with no DNS to recover from. The sibling Debian task uses backup: true as well. Co-Authored-By: Mohamed Achoubie <mohamed.achoubie.ext@culture.gouv.fr>
4f6ab9b to
9c1fb1d
Compare



Build the cas-server container image with jib, like every api/* module:
cas/pom.xml has no , cas-server inherits nothing from the root
pluginManagement, where that binding lives for the other modules. The
module keeps jib.skip=true so a local mvn install never pushes;
Jenkinsfile.containers overrides it with -Djib.skip=false.
base image as the other services instead of falling back to jib's Jetty
default for war packaging.
HTTP registry push performed by Jenkinsfile.containers
(-DsendCredentialsOverHttp=true).
whole target/ tree into /app/ (classes, the exploded war, maven-status,
generated sources), which embedded the payload several times in the image.
Prefix SPRING_APPLICATION_NAME with vitamui- in the container systemd unit
template. Every application.yml.j2 declares
spring.application.name: vitamui- and derives
spring.cloud.consul.discovery.serviceName from it, and vitamui_vars.yml
resolves peers as vitamui-.service.<consul_domain>. The environment
variable was overriding the yml with the short name, so services started in
container mode registered in Consul under the wrong name.
Keep backup: true on the /etc/resolv.conf blockinfile in the consul role. It
is the only rollback copy of the resolver configuration; without it a bad edit
leaves the host with no DNS to recover from. The sibling Debian task uses
backup: true as well.