-
Notifications
You must be signed in to change notification settings - Fork 64
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
[Integration][Amplication] add initial version of Amplication integration #1354
base: main
Are you sure you want to change the base?
Conversation
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! please address those changes
integrations/amplication/Dockerfile
Outdated
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.
no need for this file, we manage the image build from a singular Dockerfile under integrations/_infra
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.
no need for this file
"method": "POST", | ||
"headers": { | ||
"RUN_ID": "{{ .run.id }}", | ||
"authorization": "Bearer {{ .secrets.amplication_token }}" |
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.
this will not work, as .secrets.*
is a context of Port organization's managed secrets rather than the integration's env params. as for now, this token ingestion needs to be done manually
"authorization": "Bearer {{ .secrets.amplication_token }}" | |
"authorization": "Bearer <YourAmplicationToken>" |
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.
@omby8888 I'm sorry, but I don't follow. I see an example to this comment in GitLab's integration:
"url": "https://gitlab.com/api/v4/projects/<YourGitlabProject>/ref/main/trigger/pipeline?token=<YourGitlabToken>" |
but it means users which install Amplication's integration will have to go to the two self-service actions and add the token there, instead of going to the Manage secrets panel, like the suggestion in the Edit Action's Backend tab:
Configure the invocation payload
The following values ... You can reference secrets using {{ .secrets["secret-name"] }}
It actually work for us now with our sandbox, so this is why I'm confused.
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.
BTW, looks like when installing an integration, the token requested in spec.yaml
(the field[s] with the sensitive: true
value) are saved as secrets automatically, so I could access them with _<INTEGRATION_NAME>_<CONFIGURATION_SPEC_NAME>
, right?
"method": "POST", | ||
"headers": { | ||
"RUN_ID": "{{ .run.id }}", | ||
"authorization": "Bearer {{ .secrets.amplication_token }}" |
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.
same here
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.
Same as above
@@ -0,0 +1,57 @@ | |||
createMissingRelatedEntities: True | |||
|
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.
remove break line
integrations/amplication/config.yaml
Outdated
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.
no need for this file
@@ -0,0 +1,113 @@ | |||
[tool.poetry] | |||
name = "amplication" | |||
version = "0.1.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.
make it beta for now please
version = "0.1.0" | |
version = "0.1.0-beta" |
headers=await self.auth_headers, | ||
) | ||
response.raise_for_status() | ||
return response.json()["data"]["catalog"]["data"] |
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.
add safeguards here please
headers=await self.auth_headers, | ||
) | ||
response.raise_for_status() | ||
return response.json()["data"]["outdatedVersionAlerts"] |
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.
same
headers=await self.auth_headers, | ||
) | ||
response.raise_for_status() | ||
return response.json()["data"]["catalog"]["data"] |
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.
same
Thanks @omby8888 , I fixed most of the stuff you asked, the only open issue is the use of |
Description
What: This PR introduces an integration that imports Amplication templates, resources (services), and outdated version alerts into Port. The integration provides a seamless way to sync backend services and their metadata generated by Amplication into Port's service catalog. In addition, there's a self service action which creates an Amplication resource using a webhook.
Why: This integration was built to bridge the gap between backend service creation (Amplication) and infrastructure management (Port). By enabling automatic imports and alerts, it centralizes service metadata for better organization and visibility and saves time by automating manual data entry and tracking. By automating scaffolding using Amplication via Port, the developer can create consistent and standard boilerplate and foundation.
How: By using the
catalog
API endpoint, we imported the templates and resources. By using theoutdatedVersionAlerts
endpoint, we imported the alerts. By making relations between templates, resources and alerts, we can show everything in bright colours.Type of change
Please leave one option from the following and delete the rest:
All tests should be run against the port production environment(using a testing org).
Core testing checklist
Integration testing checklist
examples
folder in the integration directory.Preflight checklist
Screenshots
templates
index with theirresource_count
template
entity with itsresources
resource
entity with itsalerts
Creating an Amplication service from template action
![Screenshot 2025-01-26 at 17 08 04](https://private-user-images.githubusercontent.com/971236/406743134-90603337-08fc-4ee9-ac04-ef7b2a4357fe.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3Mzk0MDU0ODAsIm5iZiI6MTczOTQwNTE4MCwicGF0aCI6Ii85NzEyMzYvNDA2NzQzMTM0LTkwNjAzMzM3LTA4ZmMtNGVlOS1hYzA0LWVmN2IyYTQzNTdmZS5wbmc_WC1BbXotQWxnb3JpdGhtPUFXUzQtSE1BQy1TSEEyNTYmWC1BbXotQ3JlZGVudGlhbD1BS0lBVkNPRFlMU0E1M1BRSzRaQSUyRjIwMjUwMjEzJTJGdXMtZWFzdC0xJTJGczMlMkZhd3M0X3JlcXVlc3QmWC1BbXotRGF0ZT0yMDI1MDIxM1QwMDA2MjBaJlgtQW16LUV4cGlyZXM9MzAwJlgtQW16LVNpZ25hdHVyZT1kYmI0NjViNDE1ZTEyMzU5MmFiMTgxNmYwNmI1MWFiZGU2YWJiZjJhZWZmYTE1ZGU1YTViOTQ2ZGI0N2EwZjIzJlgtQW16LVNpZ25lZEhlYWRlcnM9aG9zdCJ9.veHNfjktxNt77ySoWry5WIUjzcY2plWO8hS4js_Smvo)
API Documentation
Since we're using GraphQL, the API documentation can be found in our GraphQL Playground, in our sandbox server. We use two queries, catalog and outdatedVersionAlerts and you can find their docs in the DOCS button to the right side of the page.