• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

stacklok / minder / 10940408195
53%

Build:
DEFAULT BRANCH: main
Ran 19 Sep 2024 12:02PM UTC
Jobs 1
Files 252
Run time 1min
Badge
Embed ▾
README BADGES
x

If you need to use a raster PNG badge, change the '.svg' to '.png' in the link

Markdown

Textile

RDoc

HTML

Rst

19 Sep 2024 11:53AM UTC coverage: 52.699% (+0.1%) from 52.58%
10940408195

push

github

web-flow
Add a method to retrieve an entity by upstream ID with a hint (#4519)

* Rename EntityWithProperties to EntityWithPropertiesByID

We're about to add a different `EntityWithPropertiesByUpstreamID` so
let's make the names more descriptive.

* Add EntityWithPropertiesByUpstreamHint

When processing a webhook payload, we typically only have the
information from the webhook payload available which is to say
information about the upstream entity. We even don't know exactly which
provider and which project are we handling.

We used to sort of wing it in the github webhook handler and were just
searching by upstream ID as if it was globally unique, but that no
longer works with the introduction of multiple providers where several
entities might have the same upstream ID or the same name, just in different providers.

To handle that, we add a new method to the properties service that
searches by upstream properties with a hint. At the moment, the interface
supports providerID, projectID and provider implements as a hint.

The immediate use is that the github provider will search by the
upstream ID with the hint set to ProviderTypeGithub as that's
implemented both by the app and OAuth github providers.

If any attribute of the hint is set, then the entity's attribute must
match the hint, otherwise the entity is filtered out. Additionally, once
the entity is found, the hint might contain a property with a value that
must match. The use-case there would be deleting entities where we want
to ensure that we are deleting an entity with an appropriate upstream
hook ID.

If no entities match the hints or if multiple entities match a hint, an
error is returned.

Related: #4327

* getAllByProperty returns an empty list, not ErrEntityNotFound, their callers convert it to ErrEntityNotFound if needed

117 of 147 new or added lines in 8 files covered. (79.59%)

1 existing line in 1 file now uncovered.

13921 of 26416 relevant lines covered (52.7%)

42.67 hits per line

Jobs
ID Job ID Ran Files Coverage
1 10940408195.1 19 Sep 2024 12:02PM UTC 0
52.7
GitHub Action Run
Source Files on build 10940408195
Detailed source file information is not available for this build.
  • Back to Repo
  • Github Actions Build #10940408195
  • d869bce7 on github
  • Prev Build on main (#10939518295)
  • Next Build on main (#10941451958)
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc