Skip to content

Fix Backend (api) CI failure in DemoUploadCountIT raw SQL path - #8

Draft
mudabs with Copilot wants to merge 2 commits into
mainfrom
copilot/fix-failing-github-actions-job-backend-api
Draft

mudabs with Copilot wants to merge 2 commits into
mainfrom
copilot/fix-failing-github-actions-job-backend-api

Conversation

Copilot AI commented Oct 6, 2026 •

Copy link
Copy Markdown
Contributor

The Backend (api) GitHub Actions job was failing on DemoUploadCountIT.rawInsertDefaultsToNotSeededSoItCounts with a foreign-key violation on media.event_id. The test mixed JPA persistence with raw JdbcTemplate insert semantics under transactional test execution, causing nondeterministic visibility of the inserted events row.

  • Root cause

    • rawInsertDefaultsToNotSeededSoItCounts executed inside the class-level transactional test context.
    • The raw SQL insert into media could observe state before the parent events row was durably visible, tripping media_event_id_fkey.
  • Change made

    • Scoped only the failing test method to run outside transactional wrapping by adding:
      • @Transactional(propagation = Propagation.NOT_SUPPORTED)
    • No production code paths were modified.
  • Resulting behavior

    • The test now validates DB default behavior (demo_seeded = false) without transaction boundary interference.
@Test
@Transactional(propagation = Propagation.NOT_SUPPORTED)
void rawInsertDefaultsToNotSeededSoItCounts() {
    Event event = newEvent();
    jdbc.update("""
            INSERT INTO media (id, event_id, content_type, media_type, object_key, status, moderation_state)
            VALUES (?, ?, 'image/jpeg', 'PHOTO', ?, 'UPLOADED', 'VISIBLE')
            """, UUID.randomUUID(), event.getId(), "raw/" + UUID.randomUUID());
    assertThat(media.countByEventIdAndDemoSeededFalse(event.getId())).isEqualTo(1);
}

@coderabbitai

coderabbitai Bot commented Oct 6, 2026 •

Copy link
Copy Markdown

Important

Review skipped

Bot user detected.

To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration
  • Configuration used: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 637b247c-72b7-4e51-a7ef-429338af1b0a

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
  • Autopilot · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

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.

❤️ Share

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

Co-authored-by: mudabs <92596644+mudabs@users.noreply.github.com>
Copilot AI changed the title [WIP] Fix the failing GitHub Actions job 'Backend (api)' Fix Backend (api) CI failure in DemoUploadCountIT raw SQL path Oct 6, 2026
Copilot AI requested a review from mudabs October 6, 2026 03:30
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.

2 participants