Skip to content

Commit

Permalink
Diff between Active Resources in PR (#160)
Browse files Browse the repository at this point in the history
* Add redis and change message

* Update open-pr.yml - Active Resources diff

* Update open-pr.yml - .status.resource

* Update open-pr.yml - diff || true

* Update open-pr.yml - Fix diff || true

* Update score.yaml
  • Loading branch information
mathieu-benoit authored Dec 10, 2024
1 parent 4b87a6c commit e9e37a6
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 0 deletions.
23 changes: 23 additions & 0 deletions .github/workflows/open-pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -266,6 +266,29 @@ jobs:
echo "</details>" >> pr_message.txt
fi
echo "<details><summary>Active Resources diff</summary>" >> pr_message.txt
echo "" >> pr_message.txt
echo "### Active Resources diff:" >> pr_message.txt
echo '```json' >> pr_message.txt
echo "" >> pr_message.txt
humctl get active-resource \
--env ${{ env.ENVIRONMENT_ID }} \
--token ${{ secrets.HUMANITEC_TOKEN }} \
--org ${{ secrets.HUMANITEC_ORG }} \
--app ${{ vars.APP_NAME }} \
-o json | jq '.[] | [.metadata.type, .metadata.res_id, .status.class, .status.driver_type, .status.def_id, .status.resource]' > res-usage-${{ env.ENVIRONMENT_ID }}.txt
humctl get active-resource \
--env ${{ env.BASE_ENVIRONMENT }} \
--token ${{ secrets.HUMANITEC_TOKEN }} \
--org ${{ secrets.HUMANITEC_ORG }} \
--app ${{ vars.APP_NAME }} \
-o json | jq '.[] | [.metadata.type, .metadata.res_id, .status.class, .status.driver_type, .status.def_id, .status.resource]' > res-usage-${{ env.BASE_ENVIRONMENT }}.txt
diff res-usage-${{ env.BASE_ENVIRONMENT }}.txt res-usage-${{ env.ENVIRONMENT_ID }}.txt >> pr_message.txt || true
echo "" >> pr_message.txt
echo '```' >> pr_message.txt
echo "" >> pr_message.txt
echo "</details>" >> pr_message.txt
if [ "$DEPLOYMENT_ERRORS" = "[]" ]; then
echo "<details><summary>Resources Graph</summary>" >> pr_message.txt
echo "" >> pr_message.txt
Expand Down
2 changes: 2 additions & 0 deletions score/score.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@ containers:
variables:
MESSAGE: "Hello, World!"
resources:
my-redis:
type: redis
dns:
type: dns
route:
Expand Down

0 comments on commit e9e37a6

Please sign in to comment.