-
Notifications
You must be signed in to change notification settings - Fork 5.8k
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
feat: add AwsS3EntityProvider
as replacement for AwsS3DiscoveryProcessor
#10480
feat: add AwsS3EntityProvider
as replacement for AwsS3DiscoveryProcessor
#10480
Conversation
Changed Packages
|
09399fc
to
b05d156
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice work Patrick! 🙌 I've added some suggestions :)
b05d156
to
20813e6
Compare
I rebased on master since PR #10454 was merged to make it a bit more clean here |
20813e6
to
760f6fe
Compare
760f6fe
to
3c45683
Compare
plugins/catalog-backend-module-aws/src/credentials/AwsCredentials.ts
Outdated
Show resolved
Hide resolved
3c45683
to
66a129e
Compare
66a129e
to
bf341ab
Compare
Hmm just wondering if we should skip the deprecation of the older stuff for now, just until we can confirm that the provider API's that we've settled on are right and do everything that we want before losing support for things that might have been supported in the |
@benjdlambert the provider does the same thing as the processor -- just that changes will not cause orphans. Also, deprecating it will not remove it yet. This breaking change could come at a later step. But of course, deprecating it suggests users to migrate. At the moment, I don't see a value of the processor anymore though. But maybe I miss something. If you prefer to remove the deprecation it can be done, of course. Not sure about the docs then though. I would find it a bit confusing to have both there (as user). |
Yeah sorry, I didn't mean in your implementation, I just meant from our side let's not get people to migrate until we're settled on |
@benjdlambert as a user, I would prefer providers due to the orphans created when using processors. Also a reason why I contributed this one and plan to contribute a few more. As next level, I would see event-based updates vs those (full) syncs. A combination like initial full sync + event-based updates + full syncs once in a while as auto-healing would work fine. For event-based updates, webhook-based change events as from SCM systems or other evens like S3 events can be interesting, maybe buffered in a queue; so general JMS support might make sense. Inside backstage, this could be solved with adaptors for the different providers converting events into a unified event schema or triggering APIs directly. |
processors are still great to enhance/modify entities. Ingestion I would leave to providers. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Man, it's getting way too late, some early comments before reading through fully
plugins/catalog-backend-module-aws/src/providers/AwsS3EntityProviderFactory.ts
Outdated
Show resolved
Hide resolved
bf341ab
to
1ffbca6
Compare
plugins/catalog-backend-module-aws/src/providers/AwsS3EntityProviderFactory.ts
Outdated
Show resolved
Hide resolved
plugins/catalog-backend-module-aws/src/providers/AwsS3EntityProvider.ts
Outdated
Show resolved
Hide resolved
00d918f
to
dc6c5cf
Compare
dc6c5cf
to
5c56632
Compare
just added the option to omit the provider ID in the config for the single config use case using "default" as ID. # app-config.yaml
catalog:
providers:
awsS3:
# uses "default" as provider ID
bucketName: sample-bucket
prefix: prefix/ # optional
region: us-east-2 # optional, uses the default region otherwise |
5c56632
to
09ce01b
Compare
…cessor` Add a new provider `AwsS3EntityProvider` as a replacement for the now deprecated `AwsS3DiscoveryProcessor`. The new provider will scan configured S3 buckets (with optional) prefix and add `Location` entities for all discovered catalog files. These `Location` entities will then be processed as usual. At each execution, the provider will apply a full mutation, replacing all previous entities with the new entities/state. Relates-to: backstage#10183 Signed-off-by: Patrick Jungermann <Patrick.Jungermann@gmail.com>
09ce01b
to
5969c4b
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's merge and tweak!
// and the default integration will be added as second integration. | ||
// In this case, we still want the first one though, but have no means to select it | ||
// just from the bucket name (and region). | ||
const integration = ScmIntegrations.fromConfig(configRoot).awsS3.list()[0]; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
thought for the future: this actually can never be undefined at the current point in time, but if we ever changed the behavior to not add a default entry silently, it might have been wise to be defensive here and throw an error if integration turned out to be undefined
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
good point. I can create a PR to add this.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
follow-up PR #10697
return `${endpoint}/${bucketName}/${key}`; | ||
} | ||
|
||
return `https://${bucketName}.s3.${this.config.region}.amazonaws.com/${key}`; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we would have to check if the target was really an amazon one right?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We already check these cases in the lines before. If we don't point to the real AWS S3, we need to provide the endpoint
config property (e.g., when LocalStack is used, etc.). So, I'd say it is already covered.
Relates-to: PR backstage#10480 Signed-off-by: Patrick Jungermann <Patrick.Jungermann@gmail.com>
Relates-to: PR backstage#10480 Signed-off-by: Patrick Jungermann <Patrick.Jungermann@gmail.com>
Relates-to: PR backstage#10480 Signed-off-by: Patrick Jungermann <Patrick.Jungermann@gmail.com>
Relates-to: PR backstage#10480 Signed-off-by: Patrick Jungermann <Patrick.Jungermann@gmail.com>
Relates-to: PR backstage#10480 Signed-off-by: Patrick Jungermann <Patrick.Jungermann@gmail.com>
Relates-to: PR backstage#10480 Signed-off-by: Patrick Jungermann <Patrick.Jungermann@gmail.com>
I just realized that applying the "allow" catalog rule to locations emitted by an entity provider only supports the global config. For the awsS3 processor, this was not really the case as the processor's Location can have a the Location-specific "allow" rule and itself only emits the entities contained within the S3 objects/catalog files. Hence, the rule was applied successfully. For other processors which emit Locations as well like the SCM-related processors for github, gitlab, bitbucket, etc. should be impacted by this limitation as well. In order to mitigate this, you need to ensure that to be added entities are allowed by the global rule. Not yet sure what would be the right strategy to have a custom configuration for the provider (instance) and be more restrictive at the global rule. 🤔 |
issue #12880 as follow up related to the "allow" rule |
Add a new provider
AwsS3EntityProvider
as a replacement for the now deprecatedAwsS3DiscoveryProcessor
.The new provider will scan configured S3 buckets (with optional) prefix and
add
Location
entities for all discovered catalog files.These
Location
entities will then be processed as usual.At each execution, the provider will apply a full mutation, replacing all previous
entities with the new entities/state.
Relates-to: #10183
Signed-off-by: Patrick Jungermann Patrick.Jungermann@gmail.com
Hey, I just made a Pull Request!
✔️ Checklist
Signed-off-by
line in the message. (more info)