Skip to content

Fix handling for missing SP logo#8409

Merged
aduth merged 1 commit intomainfrom
aduth-fix-logo-500
May 16, 2023
Merged

Fix handling for missing SP logo#8409
aduth merged 1 commit intomainfrom
aduth-fix-logo-500

Conversation

@aduth
Copy link
Contributor

@aduth aduth commented May 16, 2023

🛠 Summary of changes

Fixes an error which can happen if the logo associated with a service provider cannot be resolved.

Related Slack discussion: https://gsa-tts.slack.com/archives/C0NGESUN5/p1684269870234819

The problems are:

  • The error handler was added in Replace Sprockets with Propshaft #8387, where previously the method always returned from image_path. The logic of image_path always returns a string, even if not found (source), but we returned nil instead in the error handler.
  • Spec coverage was lacking:
    • We thought we were testing for a string return value, but there was a bug in the assertion (see .is_a? change)
    • We had no spec coverage for this scenario in the _nav_branded.html.erb specs, which is where the error was happening

changelog: Internal, Build Tooling, Update asset pipeline to replace Sprockets with Propshaft
@aduth aduth requested a review from mitchellhenke May 16, 2023 21:00
Copy link
Contributor

@zachmargolis zachmargolis left a comment

Choose a reason for hiding this comment

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

LGTM

service_provider_request: ServiceProviderRequestProxy.new,
)

expect(subject.sp_logo_url).is_a? String
Copy link
Contributor

Choose a reason for hiding this comment

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

oops that was not an assertion! glad we caught

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yeah 😬 I also did a regex search expect\(.+?\)\.is_a to find any others, looks like this is the only one.

@aduth aduth merged commit e3da0a7 into main May 16, 2023
@aduth aduth deleted the aduth-fix-logo-500 branch May 16, 2023 21:21
aduth added a commit that referenced this pull request May 17, 2023
aduth added a commit that referenced this pull request May 17, 2023
* Revert "Fix handling for missing SP logo (#8409)"

This reverts commit e3da0a7.

* Revert "Try absolute path for Propshaft assets (#8402)"

This reverts commit 8a97e26.

* Revert "Replace Sprockets with Propshaft (#8387)"

This reverts commit c8d8a38.

* Keep spec improvements from e3da0a7

* Keep spec improvements from c8d8a38

* Keep webpack digest suffix from c8d8a38
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.

3 participants