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

Branch deletion handling with GitLab #718

Open
james-bostock-cx opened this issue May 3, 2021 · 1 comment
Open

Branch deletion handling with GitLab #718

james-bostock-cx opened this issue May 3, 2021 · 1 comment
Assignees
Labels

Comments

@james-bostock-cx
Copy link
Collaborator

Describe the problem

According to this GitLab issue, when a branch is deleted, GitLab sends a specially populated push event. Currently CxFlow does not handle this. I have not tested it but I imagine that it behaves as it does for BitBucket server (see issue #644).

Proposed solution

Implement the same logic as in GitHub to not scan delete push events and to delete SAST projects for the branch.

Additional details

Here is the sample push payload, associated with branch deletion, from the issue linked to above. Properties with values specific to a branch deletion push event are marked with //important.

{
  "object_kind": "push",
  "event_name": "push",
  "before": "25f858bc3cdfcb6c34cf386612be1f8eedc374ba",
  "after": "0000000000000000000000000000000000000000", //important
  "ref": "refs/heads/deleted_branch_name", //deleted branch ref
  "checkout_sha": null, //important
  "message": null,
  "user_id": 7,
  "user_name": "Developer",
  "user_username": "developer",
  "user_email": "[email protected]",
  "user_avatar": "https://example.com/image.jpeg",
  "project_id": 1,
  "project": {
    "id": 1,
    "name": "My project",
    "description": null,
    "web_url": "https://example.com/default/my_project",
    "avatar_url": null,
    "git_ssh_url": "[email protected]:my_project.git",
    "git_http_url": "https://example.com/default/my_project.git",
    "namespace": "default",
    "visibility_level": 0,
    "path_with_namespace": "default/my_project",
    "default_branch": "develop",
    "ci_config_path": null,
    "homepage": "https://example.com/default/my_project",
    "url": "[email protected]:my_project.git",
    "ssh_url": "[email protected]:my_project.git",
    "http_url": "https://example.com/default/my_project.git"
  },
  "commits": [
    
  ],
  "total_commits_count": 0,
  "repository": {
    "name": "My Repository",
    "url": "[email protected]:my_project.git",
    "description": null,
    "homepage": "https://example.com/default/my_project",
    "git_ssh_url": "[email protected]:my_project.git",
    "git_http_url": "https://example.com/default/my_project.git",
    "visibility_level": 0
  }
}
@james-bostock-cx james-bostock-cx added the enhancement New feature or request label May 3, 2021
@james-bostock-cx
Copy link
Collaborator Author

Looking through all the open issues for CxFlow, I found #509, which is a request for the same thing, I think.

@jbrotsos jbrotsos self-assigned this Jun 2, 2021
@jbrotsos jbrotsos added the priority:low Low Priority label Jun 2, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants