Skip to content

feat: implement AI-based deployment job detection in workflows#970

Closed
mertilginoglu wants to merge 6 commits into
stagingfrom
feat/deploy-job-detection
Closed

feat: implement AI-based deployment job detection in workflows#970
mertilginoglu wants to merge 6 commits into
stagingfrom
feat/deploy-job-detection

Conversation

@mertilginoglu

Copy link
Copy Markdown
Contributor
  • Added WorkflowAiService for detecting deployment jobs using AI.
  • Integrated AI detection into ProjectSettingsComponent with UI updates.
  • Created backend service and controller for handling detection requests.
  • Added necessary DTOs and detection logic using OpenAI.
  • Updated environment configuration for AI integration.

Motivation

Description

Testing Instructions

Prerequisites:

  • GitHub Account without having any additional access-rights (e.g. admin, owner)
  • ...

Flow:

  1. Log in to Helios as a Developer
  2. Navigate to Settings
  3. ...

Screenshots

Checklist

General

Server

  • Code is performant and follows best practices
  • I documented the Java code using JavaDoc style.

Client

  • I documented the TypeScript code using JSDoc style.
  • I added multiple screenshots/screencasts of my UI changes.
  • I translated all newly inserted strings into English and German.

@codacy-production

codacy-production Bot commented Apr 15, 2026

Copy link
Copy Markdown

Not up to standards ⛔

🟢 Issues 0 issues

Results:
0 new issues

View in Codacy

🔴 Metrics 74 complexity

Metric Results
Complexity ⚠️ 74 (≤ 20 complexity)

View in Codacy

🟢 Coverage 36.46% diff coverage · -0.12% coverage variation

Metric Results
Coverage variation -0.12% coverage variation (-1.00%)
Diff coverage 36.46% diff coverage

View coverage diff in Codacy

Coverage variation details
Coverable lines Covered lines Coverage
Common ancestor commit (aef5d83) 8429 3961 46.99%
Head commit (78157d6) 8525 (+96) 3996 (+35) 46.87% (-0.12%)

Coverage variation is the difference between the coverage for the head and common ancestor commits of the pull request branch: <coverage of head commit> - <coverage of common ancestor commit>

Diff coverage details
Coverable lines Covered lines Diff coverage
Pull request (#970) 96 35 36.46%

Diff coverage is the percentage of lines that are covered by tests out of the coverable lines that the pull request added or modified: <covered lines added or modified>/<coverable lines added or modified> * 100%

NEW Get contextual insights on your PRs based on Codacy's metrics, along with PR and Jira context, without leaving GitHub. Enable AI reviewer
TIP This summary will be updated as you push new changes.

@github-actions github-actions Bot added size:XXL and removed size:XL labels Apr 21, 2026
- Added WorkflowAiService for detecting deployment jobs using AI.
- Integrated AI detection into ProjectSettingsComponent with UI updates.
- Created backend service and controller for handling detection requests.
- Added necessary DTOs and detection logic using OpenAI.
- Updated environment configuration for AI integration.
@mertilginoglu mertilginoglu force-pushed the feat/deploy-job-detection branch from 078a61c to 853b6e7 Compare April 21, 2026 03:54
@mertilginoglu mertilginoglu marked this pull request as ready for review April 21, 2026 03:54
@mertilginoglu mertilginoglu requested a review from a team as a code owner April 21, 2026 03:54
@mertilginoglu

Copy link
Copy Markdown
Contributor Author

@codex review

@chatgpt-codex-connector chatgpt-codex-connector 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.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 853b6e7a0f

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

{
headers: {
...(token ? { Authorization: `Bearer ${token}` } : {}),
...(currentRepositoryId ? { 'X-Repository-Id': String(currentRepositoryId) } : {}),

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Use request repositoryId for X-Repository-Id header

This request builds the URL from the repositoryId argument but sets X-Repository-Id from repositoryService.currentRepositoryId(), so the path and authorization context can diverge. When they differ (for example during route transitions or if this service is reused with an explicit repository id), the backend computes roles from the header and can authorize against the wrong repository or return 403 for a valid maintainer request. Build the header from the same repositoryId argument used in the URL to keep permission checks consistent.

Useful? React with 👍 / 👎.

Comment on lines +307 to +309
const workflowId = this.detectingWorkflowId();
if (workflowId == null) {
return;

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Scope detection state to each mutation invocation

The mutation callbacks read and clear a single shared detectingWorkflowId, which races when users trigger detection on multiple workflows before earlier calls settle. In that case, one request can overwrite the id of another, causing errors to be recorded under the wrong workflow (or skipped entirely when onSettled from another call sets it to null first). Use per-invocation variables/context (onError(_, vars) and onSettled(_, _, vars)) or a per-workflow pending map instead of shared global state.

Useful? React with 👍 / 👎.

@meryemefe meryemefe changed the base branch from staging to staging-ai-integration April 27, 2026 11:04
@meryemefe meryemefe changed the base branch from staging-ai-integration to staging April 27, 2026 11:07
{},
{
headers: {
...(token ? { Authorization: `Bearer ${token}` } : {}),

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

We can use openapi here instead of using http.post

@meryemefe meryemefe changed the base branch from staging to staging-ai-integration April 27, 2026 12:23
@helios-staging-aet helios-staging-aet Bot had a problem deploying to artemis-test7.artemis.cit.tum.de April 27, 2026 13:19 Failure
@github-actions

github-actions Bot commented May 4, 2026

Copy link
Copy Markdown

There hasn't been any activity on this pull request recently. Therefore, this pull request has been automatically marked as stale and will be closed if no further activity occurs within seven days. Thank you for your contributions.

@meryemefe meryemefe force-pushed the staging-ai-integration branch from abcd835 to 6840695 Compare May 5, 2026 11:55
@github-actions github-actions Bot removed the stale label May 5, 2026
@helios-aet helios-aet Bot temporarily deployed to test-server-3 May 5, 2026 14:42 Inactive
@helios-aet helios-aet Bot temporarily deployed to test-server-4 May 5, 2026 14:43 Inactive
@meryemefe meryemefe force-pushed the staging-ai-integration branch from fb96bf0 to 350db1a Compare May 9, 2026 17:29
Base automatically changed from staging-ai-integration to staging May 9, 2026 18:47
@github-actions

Copy link
Copy Markdown

There hasn't been any activity on this pull request recently. Therefore, this pull request has been automatically marked as stale and will be closed if no further activity occurs within seven days. Thank you for your contributions.

@github-actions

Copy link
Copy Markdown

There hasn't been any activity on this pull request recently. Therefore, this pull request has been automatically marked as stale and will be closed if no further activity occurs within seven days. Thank you for your contributions.

@github-actions github-actions Bot added the stale label May 26, 2026
…tection

# Conflicts:
#	client/src/app/core/modules/openapi/schemas.gen.ts
#	client/src/app/core/modules/openapi/sdk.gen.ts
#	client/src/app/core/modules/openapi/types.gen.ts
#	server/application-server/.env.example
#	server/application-server/build.gradle
#	server/application-server/openapi.yaml
#	server/application-server/src/main/java/de/tum/cit/aet/helios/ai/AiProperties.java
#	server/application-server/src/main/resources/application.yml
@github-actions github-actions Bot added size:XL and removed size:XXL labels May 27, 2026
@krusche

krusche commented May 28, 2026

Copy link
Copy Markdown
Member

Rebased on current staging and migrated to spring-ai:2.0.0-M8 per maintainer direction. The bulk of the conflict was that staging had already absorbed the full ai/ infrastructure (the testfailure PR shipped AiProvider, OpenAiProvider, AiProviderRegistry, AiTextUtils, AiProperties — all on 2.0.0-M8). So I:

  • Dropped this PR's duplicate AI infrastructure (byte-identical to staging's), keeping only the net-new workflow/detection/ feature, the GitRepoSettingsController endpoint, the project-settings UI, and workflow-ai.service.ts. The feature already consumed the abstraction (providerRegistry.resolve(...).call(systemPrompt, userPrompt, Schema.class)), so no spring-ai 2.x API leaks into it.
  • Took staging's config wholesale for build.gradle (bom 2.0.0-M8 + spring-ai-starter-model-openai), application.yml (dropped the obsolete spring.ai.model.* selector block + retry.exclude-on-http-codes), .env.example, and AiProperties.java (staging's is a superset).
  • Regenerated openapi.yaml (server booted, /detect-deployment-job endpoint confirmed present) and the client (sdk.gen.ts exports detectDeploymentJob).

Local verification: server compiles, OpenAiProviderTest + WorkflowDeploymentJobDetectionServiceTest + GitRepoSettingsControllerTest pass, client builds + lints clean (eslint 10).

CI is green on every functional check (OpenAPI validation, all linting, client-tests, Codacy coverage). The single red — Codacy "Complexity +74" — is an action_required advisory dominated by generated files (@tanstack/...gen.ts +27, sdk.gen.ts +3); maintainer-dismissable.

@github-actions

Copy link
Copy Markdown

🚨 Client Code Validation Failed 🚨

The client code in /client/src/app/core/modules/openapi is not up-to-date.
Please regenerate the client code by running:

cd ./client
pnpm generate:openapi

Commit and push the updated files.

@github-actions github-actions Bot removed the stale label May 28, 2026
@github-actions

github-actions Bot commented Jun 5, 2026

Copy link
Copy Markdown

There hasn't been any activity on this pull request recently. Therefore, this pull request has been automatically marked as stale and will be closed if no further activity occurs within seven days. Thank you for your contributions.

@github-actions github-actions Bot added the stale label Jun 5, 2026
@github-actions github-actions Bot closed this Jun 19, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants