Skip to content
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 sentry-release deploy task #77

Merged
merged 6 commits into from
Jul 6, 2023

Conversation

kseniyashaydurova
Copy link
Contributor

@kseniyashaydurova kseniyashaydurova commented Jun 23, 2023

Add Sentry releases and sourcemaps (for frontend) functionality.

https://saritasa.atlassian.net/browse/SD-625 - add sourcemaps (frontend)
https://saritasa.atlassian.net/browse/SD-624 - add releases (python and other apps)

Tested on ci-experiments on rocks EKS

frontend:

django:

kaniko-backend:

kaniko-frontend:

Firstly I thought that adding build-static step to kaniko is good (i.e. we have interesnee-frontend project, which is built by kaniko), but then I found that it won't work ok, because basically we use kaniko deployments for frontend in cases, when we need to install some extra dependency, like https://github.com/saritasa-nest/interesnee-frontend/blob/develop/ci/docker/Dockerfile#L9 (https://tekton.saritasa.rocks/#/namespaces/ci-experiments/pipelineruns/saritasa-ci-experiments-kaniko-frontend-dev-kaniko-build-pb778t)

So basically we wouldn't be able to prepare static for kaniko frontend projects, because to do this we need original docker image deps, which are only inside docker image. Also we are not able to copy built static from docker image during build process, because we will have to run docker image for that and copy stuff from inner folder to tekton build folder.

So I suggest to make sentry-sourcemaps upload logic for kaniko-frontend directly inside Dockerfile (if it is needed), we just add here Sentry related secrets as env vars only.

This is what happens when Sentry Token becomes invalid (when Sentry client leaves us). - https://tekton.saritasa.rocks/#/namespaces/ci-experiments/pipelineruns/saritasa-ci-experiments-django-backend-dev-build-pipeline-cf5rk?pipelineTask=sentry-release&step=release
image

@dmitry-mightydevops
Copy link
Contributor

@kseniyashaydurova I am unable to login into sentry
image

@dmitry-mightydevops
Copy link
Contributor

@kseniyashaydurova when I'm opening release info
https://sentry.saritasa.rocks/organizations/saritasa/releases/d48fcf1ca08c14e6009bf7d139527d6cc30cff0b/files-changed/?project=43

I get this
image

it doesn't look like real info or "changes" associated with SHA commit?

@dmitry-mightydevops
Copy link
Contributor

Also for django releases
https://sentry.saritasa.rocks/organizations/saritasa/releases/70a81b36224a0a83d5a279938345ce0bee517cac/files-changed/?cursor=40%3A2%3A0&project=40

it shows all files in FILES CHANGED (127) - that feels like too much to me as well.

@kseniyashaydurova
Copy link
Contributor Author

kseniyashaydurova commented Jun 30, 2023

@kseniyashaydurova when I'm opening release info https://sentry.saritasa.rocks/organizations/saritasa/releases/d48fcf1ca08c14e6009bf7d139527d6cc30cff0b/files-changed/?project=43

I get this image

it doesn't look like real info or "changes" associated with SHA commit?

It does, because we have not ignored .angular/cache/13.2.2 folder in https://github.com/saritasa-nest/saritasa-ci-experiments-frontend repo. Removed, check out new release - https://sentry.saritasa.rocks/organizations/saritasa/releases/5e36de83a68c165e0616ac397eb5a1a30bdf8577/commits/?project=43

@kseniyashaydurova
Copy link
Contributor Author

Also for django releases https://sentry.saritasa.rocks/organizations/saritasa/releases/70a81b36224a0a83d5a279938345ce0bee517cac/files-changed/?cursor=40%3A2%3A0&project=40

it shows all files in FILES CHANGED (127) - that feels like too much to me as well.

It is ok too, Sentry releases works in the following scheme:

  1. If that is the first project release - attach all commits from the beginning to current new release (which is marked as last commit hash).
  2. If that is not first release - new release will have commits starting right after previous release last commit till the current release last commit.

So in simple words for the very 1st release we will have a bunch of all commits, for the next ones - only commits between previous and new release.

@kseniyashaydurova kseniyashaydurova force-pushed the feature/add-frontend-sentry-sourcemaps-load branch 2 times, most recently from 454363e to 355c574 Compare June 30, 2023 07:43
@kseniyashaydurova kseniyashaydurova force-pushed the feature/add-frontend-sentry-sourcemaps-load branch from 355c574 to 9bdee23 Compare June 30, 2023 07:50
@kseniyashaydurova
Copy link
Contributor Author

@dmitry-mightydevops I added fixes you asked, please check this PR again

@kseniyashaydurova kseniyashaydurova merged commit 012151c into main Jul 6, 2023
@populov populov deleted the feature/add-frontend-sentry-sourcemaps-load branch July 12, 2023 06:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request Needs Review
Projects
None yet
Development

Successfully merging this pull request may close these issues.

8 participants