Skip to content

RHINENG-22223: fix build failures - #1952

Merged
MichaelMraka merged 2 commits into
RedHatInsights:masterfrom
MichaelMraka:pr1
Nov 24, 2025
Merged

MichaelMraka merged 2 commits into
RedHatInsights:masterfrom
MichaelMraka:pr1

Conversation

@MichaelMraka

@MichaelMraka MichaelMraka commented Nov 24, 2025

Copy link
Copy Markdown
Collaborator

Secure Coding Practices Checklist GitHub Link

Secure Coding Checklist

  • Input Validation
  • Output Encoding
  • Authentication and Password Management
  • Session Management
  • Access Control
  • Cryptographic Practices
  • Error Handling and Logging
  • Data Protection
  • Communication Security
  • System Configuration
  • Database Security
  • File Management
  • Memory Management
  • General Coding Practices

Summary by Sourcery

Update tooling version and correct a test fixture for repository URL handling.

Build:

  • Bump gotestsum Go test tool version used in the Docker build image from 1.12.0 to 1.13.0.

Tests:

  • Fix a repository mirror URL in upload tests to use a valid path, ensuring the test accurately reflects expected behavior.

fixing
23.03 # golang.org/x/tools/internal/tokeninternal
23.03 /go/pkg/mod/golang.org/x/tools@v0.19.0/internal/tokeninternal/tokeninternal.go:64:9: invalid array length -delta * delta (constant -256 of type int64)
[test] | === FAIL: listener TestGetRepoPath (0.00s)
[test] | upload_test.go:423:
[test] | Error Trace: /go/src/app/listener/upload_test.go:423
[test] | Error: Expected nil, but got: couldn't parse repo mirrorlist or base_url: parse "https://rhui.redhat.com[": missing ']' in host
[test] | Test: TestGetRepoPath
@sourcery-ai

sourcery-ai Bot commented Nov 24, 2025

Copy link
Copy Markdown
Reviewer's guide (collapsed on small PRs)

Reviewer's Guide

Updates tooling in the Docker build to a newer gotestsum version and corrects a test fixture URL in upload tests to fix build and test failures.

Flow diagram for test execution with updated gotestsum and upload test URL

flowchart LR
    A["Developer pushes code"] --> B["CI triggers build"]
    B --> C["Docker builds test image"]
    C --> D["Install test tools including 'gotestsum' v1.13.0"]
    D --> E["Run unit tests via 'gotestsum'"]
    E --> F["Execute listener upload tests with corrected fixture URL"]
    F --> G{"All tests pass?"}
    G -- "Yes" --> H["Publish test results and mark build as successful"]
    G -- "No" --> I["Publish failures and mark build as failed"]
Loading

File-Level Changes

Change Details Files
Update gotestsum test runner version used in the Docker build image.
  • Bump gotest.tools/gotestsum from v1.12.0 to v1.13.0 in the optional tools installation step of the Dockerfile
  • Keep swag and golangci-lint installation behavior unchanged while ensuring compatibility with newer dependencies
Dockerfile
Fix unit test input data for repository path handling.
  • Correct the Mirrorlist URL in the TestGetRepoPath test case from an invalid URL with a stray bracket to a valid URL ending with a slash
  • Ensure the test now exercises the intended code path for valid mirrorlist URLs without causing parsing or build issues
listener/upload_test.go

Tips and commands

Interacting with Sourcery

  • Trigger a new review: Comment @sourcery-ai review on the pull request.
  • Continue discussions: Reply directly to Sourcery's review comments.
  • Generate a GitHub issue from a review comment: Ask Sourcery to create an
    issue from a review comment by replying to it. You can also reply to a
    review comment with @sourcery-ai issue to create an issue from it.
  • Generate a pull request title: Write @sourcery-ai anywhere in the pull
    request title to generate a title at any time. You can also comment
    @sourcery-ai title on the pull request to (re-)generate the title at any time.
  • Generate a pull request summary: Write @sourcery-ai summary anywhere in
    the pull request body to generate a PR summary at any time exactly where you
    want it. You can also comment @sourcery-ai summary on the pull request to
    (re-)generate the summary at any time.
  • Generate reviewer's guide: Comment @sourcery-ai guide on the pull
    request to (re-)generate the reviewer's guide at any time.
  • Resolve all Sourcery comments: Comment @sourcery-ai resolve on the
    pull request to resolve all Sourcery comments. Useful if you've already
    addressed all the comments and don't want to see them anymore.
  • Dismiss all Sourcery reviews: Comment @sourcery-ai dismiss on the pull
    request to dismiss all existing Sourcery reviews. Especially useful if you
    want to start fresh with a new review - don't forget to comment
    @sourcery-ai review to trigger a new review!

Customizing Your Experience

Access your dashboard to:

  • Enable or disable review features such as the Sourcery-generated pull request
    summary, the reviewer's guide, and others.
  • Change the review language.
  • Add, remove or edit custom review instructions.
  • Adjust other review settings.

Getting Help

@sourcery-ai sourcery-ai 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.

Hey there - I've reviewed your changes - here's some feedback:

  • By changing the test case from an invalid URL with '[' to a valid URL ending in '/', the test no longer verifies error handling for malformed URLs; consider adding a separate test case that still exercises the failure path so both valid and invalid mirrorlist formats are covered.
Prompt for AI Agents
Please address the comments from this code review:

## Overall Comments
- By changing the test case from an invalid URL with '[' to a valid URL ending in '/', the test no longer verifies error handling for malformed URLs; consider adding a separate test case that still exercises the failure path so both valid and invalid mirrorlist formats are covered.

Sourcery is free for open source - if you like our reviews please consider sharing them ✨
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.

@codecov-commenter

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 58.83%. Comparing base (1619559) to head (68d9fa7).

Additional details and impacted files
@@           Coverage Diff           @@
##           master    #1952   +/-   ##
=======================================
  Coverage   58.83%   58.83%           
=======================================
  Files         131      131           
  Lines        8407     8407           
=======================================
  Hits         4946     4946           
  Misses       2927     2927           
  Partials      534      534           
Flag Coverage Δ
unittests 58.83% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@MichaelMraka
MichaelMraka merged commit 442054a into RedHatInsights:master Nov 24, 2025
7 of 8 checks passed
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