question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

CatalogBuilder addLocationAnalyzers & setLocationAnalyzer API confusing + breaking change

See original GitHub issue

Expected Behavior

The API surface for the CatalogBuilder shouldn’t have a confusing API in regards to LocationAnalyzer related interfaces

Actual Behavior

Recently as part of #13800 the catalog-import analyze process was pushed back into the backend. On a whole this makes sense. However, it has also introduced a confusing API surface and behaviour change. There was an existing CatalogBuilder.setLocationAnalyzer method which allowed you to change the default LocationAnalyzer (defaults to RepoLocationAnalyzer). Now there is a addLocationAnalyzers. Without looking at the code this is very confusing as to which is used for what.

Under the covers though they are entirely different and the default RepoLocationAnalyzer wraps the new ScmLocationAnalyzer (which also is not inherited from the original LocationAnalyzer). Instead the implementation of. So, if you had previously implemented a custom LocationAnalzyer it won’t work as expected unless you also change that custom LocationAnalyzer to also wrap the ScmLocationAnalyzers and mimic the behaviour of the default RepoLocationAnalyzer.

I’m all for these improvements, but the current current API is just really confusing and misleading between the ScmLocationAnalyzer, LocationAnalyzer interfaces and their relationship + the 2 similar but different CatalogBuilder methods.

Possible Solutions

I haven’t fully thought through a suggested solution, but here are some options:

  • More clearly distinguish the difference between LocationAnalyzer and ScmLocationAnalyzer, by renaming one or the other concepts.
  • Maybe combine both concepts into a single concept and API surface
  • Decouple the relationship of the 2 concepts so one doesn’t rely on the other.

Issue Analytics

  • State:open
  • Created a year ago
  • Reactions:2
  • Comments:9 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
andrewthauercommented, Oct 21, 2022

Sure that works. I have a workaround now + it’s documented. I just wanted to flag this for others and maybe have a discussion on improving it in the future.

0reactions
github-actions[bot]commented, Dec 20, 2022

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Where is catalog builder designed to run? - ServiceNow
We've been having an internal debate on where to build catalog items with catalog builder. From looking at the way the publishing works...
Read more >
Catalog Builder | Creating catalog items - YouTube
Demonstrates how business owners can create service catalog items in the Catalog Builder.This video was recorded in the Quebec release.
Read more >
How to create Catalog Item in Catalog Builder - YouTube
What is Catalog Builder Catalog builder is a design portal which is used to create or edit catalog items using a visual and...
Read more >
Catalog Builder | Creating catalog item templates - YouTube
Demonstrates how catalog administrators can create service catalog item templates in the Catalog Builder.This video was recorded in the ...
Read more >
Catalog Builder | Overview - YouTube
Overview of the Catalog Builder, which provides streamlined and safe processes for scaling your enterprise service catalog development.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found