Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Tech Insights: When multiple fact retrivers are used for a check and only one returns a given fact #16929

Merged

Conversation

webark
Copy link
Contributor

@webark webark commented Mar 17, 2023

Hey, I just made a Pull Request!

This is to address the comment raised in #8516 (comment) and support the use case of

RetrieverA pulls facts and integrates with SystemA, RetrieverB pulls facts and integrates with SystemB. Both output myFact, but RetrieverA only ones that involve SystemA, and RetrieverB SystemB.

Then we can run a check like

  {
    id: 'myCheck',
    type: JSON_RULE_ENGINE_CHECK_TYPE,
    name: 'My Check',
    description: 'All my checks',
    factIds: ['RetrieverA', 'RetrieverB'],
    rule: {
      conditions: {
        all: [
          {
            fact: 'myFact',
            operator: 'equal',
            value: 'cool',
          },
        ],
      },
    },
  }

And it will pass even though RetrieverA and RetrieverB do not have the same facts

pinging @Xantier and @wejendorp

✔️ Checklist

  • [x ] A changeset describing the change and affected packages. (more info)
  • Added or updated documentation
  • [x ] Tests for new functionality and regression tests for bug fixes
  • Screenshots attached (for UI changes)
  • [x ] All your commits have a Signed-off-by line in the message. (more info)

@webark webark requested a review from a team as a code owner March 17, 2023 04:57
@webark webark requested a review from jhaals March 17, 2023 04:57
@backstage-goalie
Copy link
Contributor

backstage-goalie bot commented Mar 17, 2023

Changed Packages

Package Name Package Path Changeset Bump Current Version
@backstage/plugin-tech-insights-backend-module-jsonfc plugins/tech-insights-backend-module-jsonfc patch v0.1.28-next.0

@github-actions
Copy link
Contributor

github-actions bot commented Mar 17, 2023

Uffizzi Preview deployment-19219 was deleted.

@webark webark force-pushed the fix/tech-insights-multiple-retrivers-one-fact branch from 9132189 to 1f2698d Compare March 17, 2023 05:46
@Xantier
Copy link
Collaborator

Xantier commented Mar 17, 2023

Could you add a test case and documentation about the order of facts that are used when two of them with the same identifier are passed in.

Other than that it looks like test cases cover failure cases already so this should be good to go

@webark webark mentioned this pull request Mar 22, 2023
1 task
@github-actions
Copy link
Contributor

This PR has been automatically marked as stale because it has not had recent activity from the author. It will be closed if no further activity occurs. If the PR was closed and you want it re-opened, let us know and we'll re-open the PR so that you can continue the contribution!

@github-actions github-actions bot added the stale label Mar 24, 2023
@webark
Copy link
Contributor Author

webark commented Mar 24, 2023

Aaahh!!! no no no. I was just going to get back to it today. Shoo away stale bot!!

@Xantier Xantier removed the stale label Mar 24, 2023
…k, allow for cases where only one returns a given fact

Signed-off-by: Mark David Avery <mark@webark.cc>
@webark webark force-pushed the fix/tech-insights-multiple-retrivers-one-fact branch from 1f2698d to 9cb1db6 Compare March 26, 2023 01:39
@webark
Copy link
Contributor Author

webark commented Mar 26, 2023

@Xantier Let me know if this behavior, documentation, and test coverage fits with what you expect.

Copy link
Collaborator

@Xantier Xantier left a comment

Choose a reason for hiding this comment

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

LGTM

Copy link
Member

@jhaals jhaals left a comment

Choose a reason for hiding this comment

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

Thanks!

@jhaals jhaals merged commit 198d9b3 into backstage:master Mar 29, 2023
18 checks passed
@github-actions
Copy link
Contributor

Thank you for contributing to Backstage! The changes in this pull request will be part of the 1.13.0 release, scheduled for Tue, 18 Apr 2023.

@webark webark deleted the fix/tech-insights-multiple-retrivers-one-fact branch March 29, 2023 09:09
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.

None yet

3 participants