Skip to content

update Forge container and sample code#35

Merged
vzakharchenko merged 1 commit into
mainfrom
container_health_check_fix
Jun 4, 2026
Merged

update Forge container and sample code#35
vzakharchenko merged 1 commit into
mainfrom
container_health_check_fix

Conversation

@vzakharchenko

@vzakharchenko vzakharchenko commented Jun 4, 2026

Copy link
Copy Markdown
Member
  • Set explicit environment variables (APP_ID, ENV_NAME, ENV_ID) in dev-loop.sh.
  • Simplify manifest.yml by removing unused connect block and updating routes.
  • Adjust /health endpoint path in ContainerHealthEndpoint.
  • Refactor BusinessLogicController for improved exception handling and logic flow.

Summary

Fixes #

Type of change

  • Bug fix (non-breaking)
  • New feature / API (non-breaking or breaking — explain below)
  • Documentation only
  • Sample app (examples/atlassian-connect-forge-spring-boot-sample/)
  • CI / build / tooling
  • Refactor / tests (no behavior change)

Modules touched

  • bridge-common
  • bridge-forge-connect (Connect / Forge Remote)
  • bridge-connect-container (Forge Containers)
  • Example / frontend
  • Root docs (README, CONTRIBUTING, …)
  • None of the above (explain in Summary)

Breaking change

  • No
  • Yes — describe migration steps for consumers

How tested

mvn spotless:apply
mvn clean install
# If examples/ changed:
mvn clean install -f examples/atlassian-connect-forge-spring-boot-sample/pom.xml
  • mvn spotless:apply + mvn clean install at repo root
  • Sample build (if examples/ changed)
  • New or updated unit tests added for code changes
  • Javadoc / README updated when public behavior or setup changed

Checklist

  • PR targets main and has a focused scope (one topic when possible)
  • No secrets, real app.id, production URLs, or personal deploy scripts committed
  • I read CONTRIBUTING.md

Summary by CodeRabbit

  • Bug Fixes

    • Improved error handling for impersonation so failures are now properly captured and reported.
    • Health-check endpoint path updated for clearer service status checks.
  • Configuration

    • Deployment routing and runtime configuration adjusted, including a simplified API route for the impersonation endpoint and updated runtime target.

@coderabbitai

coderabbitai Bot commented Jun 4, 2026

Copy link
Copy Markdown

Review Change Stack

Caution

Review failed

The pull request is closed.

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 0dc601cc-b3c1-4588-9d51-4eb1ab480edc

📥 Commits

Reviewing files that changed from the base of the PR and between ed310b4 and 01bd272.

📒 Files selected for processing (3)
  • examples/atlassian-connect-forge-spring-boot-sample/core/src/main/java/sample/connect/spring/atlaskit/BusinessLogicController.java
  • examples/atlassian-connect-forge-spring-boot-sample/forge-container/manifest.yml
  • examples/atlassian-connect-forge-spring-boot-sample/forge-container/src/main/java/sample/connect/spring/atlaskit/ContainerHealthEndpoint.java

📝 Walkthrough

Walkthrough

Moves the impersonation success-path into the impersonation try block so related failures are caught; removes the app.connect bridge and adjusts Forge runtime/routing in the manifest; renames the container health endpoint path from /ping to /health.

Changes

Example App API and Configuration Updates

Layer / File(s) Summary
Impersonation error handling and exception recovery
examples/atlassian-connect-forge-spring-boot-sample/core/src/main/java/sample/connect/spring/atlaskit/BusinessLogicController.java
Impersonation now constructs AtlassianHostUser, calls fetchJiraMyself, computes the label, and returns the success message inside the existing try so exceptions from those steps are handled by the existing catch that logs and returns "Impersonation failed: <message>".
Manifest configuration cleanup and endpoint path updates
examples/atlassian-connect-forge-spring-boot-sample/forge-container/manifest.yml
Removes the app.connect bridge mapping to java-service, exposes app.runtime (nodejs24.x) directly, and updates the impersonation-ep endpoint path from /api/impersonation to /api.
Health check endpoint path rename
examples/atlassian-connect-forge-spring-boot-sample/forge-container/src/main/java/sample/connect/spring/atlaskit/ContainerHealthEndpoint.java
Updates the controller @RequestMapping base path from "/ping" to "/health"; response behavior remains "OK".

🎯 3 (Moderate) | ⏱️ ~20 minutes

🐰 I hopped through lines with eager eyes,
Moved the greeting where the catcher lies,
Manifest trimmed, routes now aligned,
Health check renamed—response refined,
A little carrot code dance, spry and kind. 🥕

🚥 Pre-merge checks | ✅ 2 | ❌ 3

❌ Failed checks (2 warnings, 1 inconclusive)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 33.33% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
Description check ⚠️ Warning PR description includes most required sections with completed type-of-change and module selections, but lacks a summary explaining the rationale for changes. Add a 1–3 sentence summary explaining what changed and why, linking to the issue number or marking as n/a.
Title check ❓ Inconclusive The title 'update Forge container and sample code' is generic and does not highlight the most important changes; it fails to convey the specific focus on exception handling refactoring, endpoint path changes, or manifest simplification. Consider a more specific title such as 'Refactor impersonation exception handling and update container health endpoint' to better communicate the key changes.
✅ Passed checks (2 passed)
Check name Status Explanation
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch container_health_check_fix

Comment @coderabbitai help to get the list of available commands and usage tips.

@codacy-production

codacy-production Bot commented Jun 4, 2026

Copy link
Copy Markdown

Up to standards ✅

🟢 Issues 0 issues

Results:
0 new issues

View in Codacy

AI Reviewer: first review requested successfully. AI can make mistakes. Always validate suggestions.

Run reviewer

TIP This summary will be updated as you push new changes.

- Set explicit environment variables (APP_ID, ENV_NAME, ENV_ID) in `dev-loop.sh`.
- Simplify `manifest.yml` by removing unused `connect` block and updating routes.
- Adjust `/health` endpoint path in `ContainerHealthEndpoint`.
- Refactor `BusinessLogicController` for improved exception handling and logic flow.
@vzakharchenko vzakharchenko force-pushed the container_health_check_fix branch from ed310b4 to 01bd272 Compare June 4, 2026 07:23
@vzakharchenko vzakharchenko enabled auto-merge June 4, 2026 07:24

@codacy-production codacy-production Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull Request Overview

While the PR is technically up to Codacy standards, there are several critical issues that should prevent merging. Most significantly, the 'dev-loop.sh' file and its associated environment variable changes—explicitly mentioned in the acceptance criteria—are missing from the diff. Additionally, the route path update in 'manifest.yml' from '/api/impersonation' to '/api' constitutes a breaking change that likely mismatches existing backend Spring controller mappings, which will lead to 404 errors for the Forge-to-Remote bridge. The refactored error handling in 'BusinessLogicController' also violates standard HTTP practices by returning 200 OK responses for failed API calls, effectively hiding errors from the client.

About this PR

  • The PR description and acceptance criteria mention setting explicit environment variables (APP_ID, ENV_NAME, ENV_ID) in a 'dev-loop.sh' file, but this file is missing from the provided changes. Please verify if the file was forgotten in the commit.
  • There are no new or updated tests included to verify the behavior of the refactored controller logic or the modified health endpoint. Given the changes to error handling and routing, automated unit or integration tests are recommended.

Test suggestions

  • Verify that the /health endpoint returns a 200 OK status
  • Verify that failures in fetchJiraMyself are caught and return the specified error message in BusinessLogicController
  • Verify that the application starts correctly with the simplified manifest.yml structure
Prompt proposal for missing tests
Consider implementing these tests if applicable:
1. Verify that the /health endpoint returns a 200 OK status
2. Verify that failures in fetchJiraMyself are caught and return the specified error message in BusinessLogicController
3. Verify that the application starts correctly with the simplified manifest.yml structure

TIP Improve review quality by adding custom instructions
TIP How was this review? Give us feedback

@qltysh

qltysh Bot commented Jun 4, 2026

Copy link
Copy Markdown

Qlty


Coverage Impact

This PR will not change total coverage.

🚦 See full report on Qlty Cloud »

🛟 Help
  • Diff Coverage: Coverage for added or modified lines of code (excludes deleted files). Learn more.

  • Total Coverage: Coverage for the whole repository, calculated as the sum of all File Coverage. Learn more.

  • File Coverage: Covered Lines divided by Covered Lines plus Missed Lines. (Excludes non-executable lines including blank lines and comments.)

    • Indirect Changes: Changes to File Coverage for files that were not modified in this PR. Learn more.

@codacy-production codacy-production Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull Request Overview

The PR streamlines the Forge sample application but introduces several concerns that should prevent merging in its current state. Most notably, 'dev-loop.sh' is missing from the diff despite being a core part of the acceptance criteria, and no tests have been provided despite the checklist indicating otherwise.

There are also two breaking changes: the renaming of the health endpoint and the modification of the base route path in the manifest. These changes will likely break infrastructure monitoring and existing client integrations if not managed. Finally, a hardcoded App ID was found in the manifest, contradicting the project's security checklist.

About this PR

  • The file 'dev-loop.sh' is missing from the PR despite being mentioned in the description and acceptance criteria. Please ensure all intended files are included in the commit.
  • The PR checklist claims new or updated unit tests are included, but no such files were found in the diff. Please include the relevant tests to verify the changes, specifically for the error handling updates in BusinessLogicController.

Test suggestions

  • Verify the health endpoint is reachable at /health and no longer at /ping.
  • Verify that exceptions in fetchJiraMyself are caught and returned as 'Impersonation failed' messages.
  • Verify that the Forge application correctly routes requests to the backend service with the updated manifest paths.
Prompt proposal for missing tests
Consider implementing these tests if applicable:
1. Verify the health endpoint is reachable at /health and no longer at /ping.
2. Verify that exceptions in fetchJiraMyself are caught and returned as 'Impersonation failed' messages.
3. Verify that the Forge application correctly routes requests to the backend service with the updated manifest paths.

TIP Improve review quality by adding custom instructions
TIP How was this review? Give us feedback

@sonarqubecloud

sonarqubecloud Bot commented Jun 4, 2026

Copy link
Copy Markdown

@vzakharchenko vzakharchenko merged commit af54820 into main Jun 4, 2026
11 of 12 checks passed
@vzakharchenko vzakharchenko deleted the container_health_check_fix branch June 4, 2026 07:26
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