Fix failing CI tests: GitClient allowlist stubs, integration test timeout properties, stable Selenium selectors - #663
Merged
Conversation
Agent-Logs-Url: https://github.com/conorheffron/ironoc/sessions/d12ea468-41d4-412d-b2d3-0de30faf76b1 Co-authored-by: conorheffron <8218626+conorheffron@users.noreply.github.com>
Agent-Logs-Url: https://github.com/conorheffron/ironoc/sessions/d12ea468-41d4-412d-b2d3-0de30faf76b1 Co-authored-by: conorheffron <8218626+conorheffron@users.noreply.github.com>
Agent-Logs-Url: https://github.com/conorheffron/ironoc/sessions/d12ea468-41d4-412d-b2d3-0de30faf76b1 Co-authored-by: conorheffron <8218626+conorheffron@users.noreply.github.com>
Agent-Logs-Url: https://github.com/conorheffron/ironoc/sessions/d12ea468-41d4-412d-b2d3-0de30faf76b1 Co-authored-by: conorheffron <8218626+conorheffron@users.noreply.github.com>
…forgery' Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>
Co-authored-by: conorheffron <8218626+conorheffron@users.noreply.github.com>
Agent-Logs-Url: https://github.com/conorheffron/ironoc/sessions/f283bc18-6796-4d53-9e08-8542e2a29816 Co-authored-by: conorheffron <8218626+conorheffron@users.noreply.github.com>
Co-authored-by: conorheffron <8218626+conorheffron@users.noreply.github.com>
Agent-Logs-Url: https://github.com/conorheffron/ironoc/sessions/e2b11e10-6ecc-4eaa-acc1-152b5e8534f2 Co-authored-by: conorheffron <8218626+conorheffron@users.noreply.github.com>
…meout props, stable Selenium selectors Co-authored-by: conorheffron <8218626+conorheffron@users.noreply.github.com>
…S selectors for iRonoc nav Agent-Logs-Url: https://github.com/conorheffron/ironoc/sessions/e2b11e10-6ecc-4eaa-acc1-152b5e8534f2 Co-authored-by: conorheffron <8218626+conorheffron@users.noreply.github.com>
Co-authored-by: conorheffron <8218626+conorheffron@users.noreply.github.com>
…lank-body error message Agent-Logs-Url: https://github.com/conorheffron/ironoc/sessions/e2b11e10-6ecc-4eaa-acc1-152b5e8534f2 Co-authored-by: conorheffron <8218626+conorheffron@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Fix GitHub Actions failures in PR #657
Fix failing CI tests: GitClient allowlist stubs, integration test timeout properties, stable Selenium selectors
May 16, 2026
conorheffron
marked this pull request as ready for review
May 17, 2026 10:47
conorheffron
approved these changes
May 17, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The
GitClientRestTemplate refactoring introduced URL allowlist validation that broke unit tests, caused Spring context failures in integration tests, and the Selenium browser test was using a fragilelinkTextlocator.GitClientTest — missing allowlist stubs
getValidatedApiUri()callspropertyConfig.getGitApiEndpointIssues()andurlUtils.isValidURL(allowlistUrl)before invokingrestTemplate.exchange(). Neither was stubbed, so the method returned early — causingexchange()to never be called in the success test and flagged asUnnecessaryStubbingExceptionin the blank-body test.Added to both
test_callGitHubApi_success_with_tokenandtest_callGitHubApi_blank_response_body_fail.BaseControllerIntegrationTest — missing timeout properties
The new
GitClientconstructor callspropertyConfig.getGitTimeoutConnect()/getGitTimeoutRead()(backed byenvironment.getRequiredProperty()). The test@TestPropertySourcedidn't include these, throwingIllegalStateExceptionduring bean creation forCoffeeControllerIntegrationTestandGitProjectsControllerIntegrationTest.RemoteBrowserBasedIntTest — fragile Selenium locator
@FindBy(linkText = "iRonoc")fails on the live site. Replaced inHomePage,AboutPage, andPortfolioPagewith a structural CSS selector that doesn't depend on exact link text:GitClient.java — minor code quality
dtosinitialized asnew ArrayList<>()instead of immutableCollections.emptyList()(was immediately reassigned on the success path)"Failed to create connection"→"Received blank response body from GitHub API"Warning
Firewall rules blocked me from connecting to one or more addresses (expand for details)
I tried to connect to the following addresses, but was blocked by firewall rules:
ads.mozilla.org/usr/lib/firefox/firefox /usr/lib/firefox/firefox --marionette --headless --disable-gpu --window-size=1920,1080 -no-remote -profile /tmp/rust_mozprofilenVfPTx(dns block)/usr/lib/firefox/firefox /usr/lib/firefox/firefox --marionette --headless --disable-gpu --window-size=1920,1080 -no-remote -profile /tmp/rust_mozprofilelwFdps HooksPath(dns block)/usr/lib/firefox/firefox /usr/lib/firefox/firefox --marionette --headless --disable-gpu --window-size=1920,1080 -no-remote -profile /tmp/rust_mozprofileScJ9mV(dns block)detectportal.firefox.com/usr/lib/firefox/firefox /usr/lib/firefox/firefox --marionette --headless --disable-gpu --window-size=1920,1080 -no-remote -profile /tmp/rust_mozprofilenVfPTx(dns block)/usr/lib/firefox/firefox /usr/lib/firefox/firefox --marionette --headless --disable-gpu --window-size=1920,1080 -no-remote -profile /tmp/rust_mozprofilelwFdps HooksPath(dns block)/usr/lib/firefox/firefox /usr/lib/firefox/firefox --marionette --headless --disable-gpu --window-size=1920,1080 -no-remote -profile /tmp/rust_mozprofileScJ9mV(dns block)firefox.settings.services.mozilla.com/usr/lib/firefox/firefox /usr/lib/firefox/firefox --marionette --headless --disable-gpu --window-size=1920,1080 -no-remote -profile /tmp/rust_mozprofilenVfPTx(dns block)/usr/lib/firefox/firefox /usr/lib/firefox/firefox --marionette --headless --disable-gpu --window-size=1920,1080 -no-remote -profile /tmp/rust_mozprofilelwFdps HooksPath(dns block)/usr/lib/firefox/firefox /usr/lib/firefox/firefox --marionette --headless --disable-gpu --window-size=1920,1080 -no-remote -profile /tmp/rust_mozprofileScJ9mV(dns block)incoming.telemetry.mozilla.org/usr/lib/firefox/firefox /usr/lib/firefox/firefox --marionette --headless --disable-gpu --window-size=1920,1080 -no-remote -profile /tmp/rust_mozprofileCczFyZ(dns block)/usr/lib/firefox/firefox /usr/lib/firefox/firefox --marionette --headless --disable-gpu --window-size=1920,1080 -no-remote -profile /tmp/rust_mozprofile6UATr9(dns block)/usr/lib/firefox/firefox /usr/lib/firefox/firefox --marionette --headless --disable-gpu --window-size=1920,1080 -no-remote -profile /tmp/rust_mozprofileSbEwkx(dns block)support.mozilla.org/usr/lib/firefox/firefox /usr/lib/firefox/firefox --marionette --headless --disable-gpu --window-size=1920,1080 -no-remote -profile /tmp/rust_mozprofilenVfPTx(dns block)/usr/lib/firefox/firefox /usr/lib/firefox/firefox --marionette --headless --disable-gpu --window-size=1920,1080 -no-remote -profile /tmp/rust_mozprofileScJ9mV(dns block)/usr/lib/firefox/firefox /usr/lib/firefox/firefox --marionette --headless --disable-gpu --window-size=1920,1080 -no-remote -profile /tmp/rust_mozprofile6UATr9(dns block)If you need me to access, download, or install something from one of these locations, you can either:
Original prompt
Apply fixes directly to PR #657 in repository
conorheffron/ironocby updating the PR branchcopilot/refactor-migrate-to-spring-boot-rest-template.Context:
25965696871, job76328701453..github/workflows/maven.yml01dd1251cec6832612aa9b98e19b19d3bad87fa8Observed failures from job logs:
GitClientTest.test_callGitHubApi_success_with_tokenfails becauserestTemplateMock.exchange(...)was expected but never called.GitClientTest.test_callGitHubApi_blank_response_body_failerrors withUnnecessaryStubbingException.CoffeeControllerIntegrationTestfails to loadApplicationContextbecause bean creation forgitClientthrows during startup.GitProjectsControllerIntegrationTestfails to loadApplicationContextbecause bean creation forgitClientthrows during startup.RemoteBrowserBasedIntTest.test_quick_tourfails with SeleniumNoSuchElementException: Unable to locate element: iRonocwhile hitting the live sitehttps://ironoc.net/.Relevant files already identified:
src/main/java/net/ironoc/portfolio/client/GitClient.javasrc/test/java/net/ironoc/portfolio/client/GitClientTest.javasrc/test/java/net/ironoc/portfolio/controller/CoffeeControllerIntegrationTest.javasrc/test/java/net/ironoc/portfolio/controller/GitProjectsControllerIntegrationTest.javasrc/test/java/net/ironoc/portfolio/RemoteBrowserBasedIntTest.javasrc/test/java/net/ironoc/portfolio/config/TestIronocConfiguration.javaImportant implementation guidance:
GitClientURL validation / allowlist hardening.GitClient.GitClientbean can be created in the test ApplicationContext without weakening production behavior.PropertyConfigI.getGitApiEndpointIssues()and related URL validation.GitClientTestto remove or avoid unnecessary Mockito stubbing and align expectations with the current code path.RemoteBrowserBasedIntTest; update the test or locators to use stable selectors. Prefer a minimal targeted fix that makes the browser test reliable in CI.Please modify the existing PR branch rather than creating a separate unrelated branch, and open/update the pull request with the fixes.
The following is the prior conversation context from the user's chat exploration (may be truncated):
User: Please find a solution for this failing job. Use the logs, job definition, and any referenced files where the failure occurred. Keep your response focused on the solution and include code suggestions when appropriate.
Assistant: The failures come from a recent hardening change in
GitClientthat now rejects requests unlessgitApiEndpointIssuesis configured and matches the target host. That broke both unit tests and Spring integration tests.Fix the root cause in tests
GitClientnow requirespropertyConfig.getGitApiEndpointIssues()to return a valid base URL. Your tests don’t stub that, so bean creation fails andcallGitHubApi()exits before the mocked exchange is reached.Relevant code:
GitClientconstructor/use path: src/main/java/net/ironoc/portfolio/client/GitClient.javaRecommended code changes
1. Update
GitClientTestsetupAdd the missing property stub so the validated URL passes:
2. Fix the unnecessary stubbing in
test_callGitHubApi_blank_response_body_failBecause the method c...
This pull request was created from Copilot chat.