Skip to content

Commit

Permalink
updated codes
Browse files Browse the repository at this point in the history
  • Loading branch information
Lucifergene authored Apr 27, 2024
1 parent d58ab2d commit 5ad223d
Show file tree
Hide file tree
Showing 2 changed files with 53 additions and 45 deletions.
97 changes: 53 additions & 44 deletions backstage/team-backstage.sh
Original file line number Diff line number Diff line change
Expand Up @@ -10,44 +10,52 @@ echo "Fetching Github data"

url1="https://api.github.com/search/issues?q=repo%3Ajanus-idp%2Fbackstage-showcase+state%3Aopen+type%3Apr+created%3A<$PREVIOUS_DT&type=Issues"
url2="https://api.github.com/search/issues?q=repo%3Ajanus-idp%2Fbackstage-plugins+state%3Aopen+type%3Apr+created%3A<$PREVIOUS_DT&type=Issues"
url3="https://api.github.com/search/issues?q=repo%3Ajanus-idp%2Fjanus-idp.github.io+state%3Aopen+type%3Apr+created%3A<$PREVIOUS_DT&type=Issues"
url3="https://api.github.com/search/issues?q=repo%3Ajanus-idp%2Foperator+state%3Aopen+type%3Apr+created%3A<$PREVIOUS_DT&type=Issues"
url4="https://api.github.com/search/issues?q=repo%3Ajanus-idp%2Fjanus-idp.github.io+state%3Aopen+type%3Apr+created%3A<$PREVIOUS_DT&type=Issues"
url5="https://api.github.com/search/issues?q=repo%3Aredhat-developer%2Fred-hat-developers-documentation-rhdh+state%3Aopen+type%3Apr+created%3A<$PREVIOUS_DT&type=Issues"

showcase_github_data="\n<https://github.com/search?l=&q=repo%3Ajanus-idp%2Fbackstage-showcase+state%3Aopen+type%3Apr | Total open PRs>: $(curl -s 'https://api.github.com/search/issues?q=repo%3Ajanus-idp%2Fbackstage-showcase+state%3Aopen+type%3Apr' -H "Accept: application/json" | jq '.total_count // 0')"
showcase_github_data+="\n<https://github.com/search?q=repo%3Ajanus-idp%2Fbackstage-showcase+state%3Aopen+type%3Apr+created%3A%3C$PREVIOUS_DT&type=Issues | PRs opened for more than a week>: $(curl -s $url1 -H "Accept: application/json" | jq '.total_count // 0')"
github_data_a="\n<https://github.com/search?l=&q=repo%3Ajanus-idp%2Fbackstage-showcase+state%3Aopen+type%3Apr | Total open PRs>: $(curl -s 'https://api.github.com/search/issues?q=repo%3Ajanus-idp%2Fbackstage-showcase+state%3Aopen+type%3Apr' -H "Accept: application/json" | jq '.total_count // 0')"
github_data_a+="\n<https://github.com/search?q=repo%3Ajanus-idp%2Fbackstage-showcase+state%3Aopen+type%3Apr+created%3A%3C$PREVIOUS_DT&type=Issues | PRs opened for more than a week>: $(curl -s $url1 -H "Accept: application/json" | jq '.total_count // 0')"

plugins_github_data="\n<https://github.com/search?l=&q=repo%3Ajanus-idp%2Fbackstage-plugins+state%3Aopen+type%3Apr | Total open PRs>: $(curl -s 'https://api.github.com/search/issues?q=repo%3Ajanus-idp%2Fbackstage-plugins+state%3Aopen+type%3Apr' -H "Accept: application/json" | jq '.total_count // 0')"
plugins_github_data+="\n<https://github.com/search?q=repo%3Ajanus-idp%2Fbackstage-plugins+state%3Aopen+type%3Apr+created%3A%3C$PREVIOUS_DT&type=Issues | PRs opened for more than a week>: $(curl -s $url2 -H "Accept: application/json" | jq '.total_count // 0')"
github_data_b="\n<https://github.com/search?l=&q=repo%3Ajanus-idp%2Fbackstage-plugins+state%3Aopen+type%3Apr | Total open PRs>: $(curl -s 'https://api.github.com/search/issues?q=repo%3Ajanus-idp%2Fbackstage-plugins+state%3Aopen+type%3Apr' -H "Accept: application/json" | jq '.total_count // 0')"
github_data_b+="\n<https://github.com/search?q=repo%3Ajanus-idp%2Fbackstage-plugins+state%3Aopen+type%3Apr+created%3A%3C$PREVIOUS_DT&type=Issues | PRs opened for more than a week>: $(curl -s $url2 -H "Accept: application/json" | jq '.total_count // 0')"

janusidp_github_data="\n<https://github.com/search?l=&q=repo%3Ajanus-idp%2Fjanus-idp.github.io+state%3Aopen+type%3Apr | Total open PRs>: $(curl -s 'https://api.github.com/search/issues?q=repo%3Ajanus-idp%2Fjanus-idp.github.io+state%3Aopen+type%3Apr' -H "Accept: application/json" | jq '.total_count // 0')"
janusidp_github_data+="\n<https://github.com/search?q=repo%3Ajanus-idp%2Fjanus-idp.github.io+state%3Aopen+type%3Apr+created%3A%3C$PREVIOUS_DT&type=Issues | PRs opened for more than a week>: $(curl -s $url3 -H "Accept: application/json" | jq '.total_count // 0')"
github_data_c="\n<https://github.com/search?l=&q=repo%3Ajanus-idp%2Foperator+state%3Aopen+type%3Apr | Total open PRs>: $(curl -s 'https://api.github.com/search/issues?q=repo%3Ajanus-idp%2Foperator+state%3Aopen+type%3Apr' -H "Accept: application/json" | jq '.total_count // 0')"
github_data_c+="\n<https://github.com/search?q=repo%3Ajanus-idp%2Foperator+state%3Aopen+type%3Apr+created%3A%3C$PREVIOUS_DT&type=Issues | PRs opened for more than a week>: $(curl -s $url3 -H "Accept: application/json" | jq '.total_count // 0')"

github_data_d="\n<https://github.com/search?l=&q=repo%3Ajanus-idp%2Fjanus-idp.github.io+state%3Aopen+type%3Apr | Total open PRs>: $(curl -s 'https://api.github.com/search/issues?q=repo%3Ajanus-idp%2Fjanus-idp.github.io+state%3Aopen+type%3Apr' -H "Accept: application/json" | jq '.total_count // 0')"
github_data_d+="\n<https://github.com/search?q=repo%3Ajanus-idp%2Fjanus-idp.github.io+state%3Aopen+type%3Apr+created%3A%3C$PREVIOUS_DT&type=Issues | PRs opened for more than a week>: $(curl -s $url4 -H "Accept: application/json" | jq '.total_count // 0')"

github_data_e="\n<https://github.com/search?l=&q=repo%3Aredhat-developer%2Fred-hat-developers-documentation-rhdh+state%3Aopen+type%3Apr | Total open PRs>: $(curl -s 'https://api.github.com/search/issues?q=repo%3Aredhat-developer%2Fred-hat-developers-documentation-rhdh+state%3Aopen+type%3Apr' -H "Accept: application/json" | jq '.total_count // 0')"
github_data_e+="\n<https://github.com/search?q=repo%3Aredhat-developer%2Fred-hat-developers-documentation-rhdh+state%3Aopen+type%3Apr+created%3A%3C$PREVIOUS_DT&type=Issues | PRs opened for more than a week>: $(curl -s $url5 -H "Accept: application/json" | jq '.total_count // 0')"

echo "Posting on slack"

data='{
text: 'GitHub Status report',
blocks: [
"text": 'GitHub Status report',
"blocks": [
{
"type": 'header',
text: {
"text": {
"type": 'plain_text',
text: head
"text": head
}
},
{
"type": 'section',
fields: [
"fields": [
{
"type": 'mrkdwn',
text: '*backstage-showcase*'
"text": '*backstage-showcase*'
}
]
},
{
"type": 'section',
fields: [
"fields": [
{
"type": 'mrkdwn',
text: github_data_a
"text": "'$github_data_a'"
},
]
},
Expand All @@ -56,19 +64,19 @@ data='{
},
{
"type": 'section',
fields: [
"fields": [
{
"type": 'mrkdwn',
text: '*backstage-plugins*'
"text": '*backstage-plugins*'
}
]
},
{
"type": 'section',
fields: [
"fields": [
{
"type": 'mrkdwn',
text: github_data_b
"text": "'$github_data_b'"
},
]
},
Expand All @@ -77,19 +85,20 @@ data='{
},
{
"type": 'section',
fields: [
"fields": [
{
"type": 'mrkdwn',
text: '*janus-idp.github.io*'
"text": '*operator*'
}
]
},
{
"type": 'section',
fields: [
"fields": [
{
"type": 'mrkdwn',
text: github_data_c
"text": "'$github_data_c'"
},
]
},
Expand All @@ -98,46 +107,46 @@ data='{
},
{
"type": 'section',
fields: [
"fields": [
{
"type": 'mrkdwn',
text: '*operator*'
"text": '*janus-idp.github.io*'
}
]
},
{
"type": 'section',
fields: [
"fields": [
{
"type": 'mrkdwn',
text: github_data_d
"text": "'$github_data_d'"
},
]
},
{
"type": 'divider'
},
{
"type": "section",
fields: [
{
"type": "mrkdwn",
text: "*red-hat-developers-documentation-rhdh*",
"type": "section",
"fields": [
{
"type": "mrkdwn",
text: "*red-hat-developers-documentation-rhdh*",
},
],
},
{
"type": "section",
"fields": [
{
"type": "mrkdwn",
text: "'$github_data_e'",
},
],
},
],
},
{
"type": "section",
fields: [
{
"type": "mrkdwn",
text: github_data_e,
"type": "divider",
},
],
},
{
"type": "divider",
},
]
}'

Expand Down
1 change: 0 additions & 1 deletion konflux/forum-koflux-ui.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ authorization="Authorization: Bearer "$1

echo "Generating Status Report"

# head="HELLO @hac-dev-team"
head='RHTAP UI'

echo "Fetching RHTAP stories"
Expand Down

0 comments on commit 5ad223d

Please sign in to comment.