status-im / status-mobile

a free (libre) open source, mobile OS for Ethereum
https://status.app
Mozilla Public License 2.0
3.91k stars 987 forks source link

Migrate classic "Pipeline for QA" project to to Projects #20580

Open churik opened 4 months ago

churik commented 4 months ago

Problem

image

We need to migrate https://github.com/status-im/status-mobile/projects/7 to new project with all automation: 1) when PR is added to repo, it should appear in https://github.com/status-im/status-mobile/projects/7 in "Review" column 2) moving to e2e column autonatically runs automation job with predefined parameters

Acceptance Criteria

Projects should be identical, and all PRs should move respectively.

siddarthkay commented 2 months ago

I checked the dokku host where the status-github-bot is hosted and it seems like "Pipeline for QA" no longer seems to be found and we may have to update the bot code to work with newer version of Github Projects.

2024-08-26T04:26:35.401131+00:00 docker/status-github-bot.web.1[169771]: 
04:26:35.400Z ERROR probot: signature does not match event payload and secret
2024-08-26T04:26:35.496415+00:00 docker/status-github-bot.web.1[169771]: 
04:26:35.495Z ERROR probot: signature does not match event payload and secret
2024-08-26T04:27:15.687549+00:00 docker/status-github-bot.web.1[169771]: 
04:27:15.687Z ERROR probot: Cannot read properties of undefined (reading 'name') Pipeline for QA
2024-08-26T04:37:16.728953+00:00 docker/status-github-bot.web.1[169771]: 
04:37:16.728Z ERROR probot: Cannot read properties of undefined (reading 'name') Pipeline for QA
2024-08-26T04:47:15.691997+00:00 docker/status-github-bot.web.1[169771]: 
04:47:15.691Z ERROR probot: Cannot read properties of undefined (reading 'name') Pipeline for QA
2024-08-26T04:57:15.710380+00:00 docker/status-github-bot.web.1[169771]: 
04:57:15.709Z ERROR probot: Cannot read properties of undefined (reading 'name') Pipeline for QA
2024-08-26T05:07:15.759895+00:00 docker/status-github-bot.web.1[169771]: 
05:07:15.759Z ERROR probot: Cannot read properties of undefined (reading 'name') Pipeline for QA
siddarthkay commented 2 months ago

Since there is a lot of old and unmaintained code in https://github.com/status-im/status-github-bot it seems like a good idea to write a new bot with 2 objectives:

I'd like to use newer version of probot -> https://github.com/probot/probot/releases/tag/v13.3.7

I'll use this issue to track my progress.

siddarthkay commented 2 months ago

https://github.com/status-im/status-github-bot-v2 made new repo for my minimalistic POC. once I get the basics right and some reviews we could rename and then archive the exiting repo.

churik commented 2 months ago

@siddarthkay bot also automatically add all PRs in repo to pipeline, we also need this.

thank you for picking it up!

siddarthkay commented 1 month ago

I finally got around to finishing a portion of the work here -> https://github.com/sidtech-solutions/github-pr-bot

The idea was to make a new github org and a new repo within the org and finish the work and when the bot is ready move it back to status-im github org, because testing a bot permission change would constantly require admin approval from github org owner and I would then have to open many PRs in status-im org to test.

Majority of the trouble to getting this to work was late realisation that projects V2 does not work with the rest api and required graphql calls instead.

So this bot now adds new PRs to the project board of our choice in the todo column.

siddarthkay commented 1 month ago

Next steps :

siddarthkay commented 3 weeks ago

We decided to get rid of Dokku host and Dokku services since they are very unreliable, Hence this bot is being deployed via its own ansible role instead of Dokku.

siddarthkay commented 3 weeks ago

@status-im/mobile-qa : I've deployed v2 of the github bot on our infra-ci fleet and I observed that https://github.com/status-im/status-mobile/pull/21457 PR was automatically added to contributors column. I also tested moving my react-native upgrade PR to E2E Tests column and saw that E2E job results were posted on the PR.

I still have some other work to do like set up an ssl proxy for it, set up some consul alerts for infra monitoring etc but the bot is useable for now and currently running.

siddarthkay commented 2 weeks ago

When I attempted to deploy the ssl proxy and use sghb.status.im instead of smee.io url provided by probot I faced the following issues :

I am debugging further on why infra-role-nginx did not create the nginx config