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

Autoplan for Bitbucket Server on pull request **update** #198

Closed
lkysow opened this issue Jul 25, 2018 · 9 comments
Closed

Autoplan for Bitbucket Server on pull request **update** #198

lkysow opened this issue Jul 25, 2018 · 9 comments
Labels
feature New functionality/enhancement provider/bitbucket

Comments

@lkysow
Copy link
Member

lkysow commented Jul 25, 2018

The current implementation of Bitbucket Server won't run plan automatically when the pull request is updated. This is because Bitbucket Server doesn't send its pr:modified event when a new commit is pushed to the pull request. It only sends this event when the title of the PR is edited or something like that.

We could instead subscribe to the repo:refs_changed repository event which would tell us when a branch was updated. We'd then look at what pull requests we have outstanding by iterating through the filesystem and then seeing if those pull requests are for the same branch at which point we could trigger the autoplan.

@lkysow lkysow mentioned this issue Jul 25, 2018
3 tasks
@frank-bee
Copy link

+1

@miked0004
Copy link

pr:deleted is not supported either. it should behave like pr:declined.
Shall I create a separate issue?

@lkysow
Copy link
Member Author

lkysow commented Feb 27, 2019

@miked0004 yes please, that should be a lot easier to fix. If you can pull the payload and paste it in a gist that would be very helpful too.

@miked0004
Copy link

Thanks @lkysow. Created #498.

@lkysow lkysow added the feature New functionality/enhancement label Apr 4, 2019
@kevinneufeld
Copy link

kevinneufeld commented Jan 18, 2020

@lkysow do you still need a gist of the event repo:refs_changed payload?

{
    "eventKey": "repo:refs_changed",
    "date": "2020-01-17T23:28:09-0800",
    "actor": {
        "name": "admin",
        "emailAddress": "admin@example.com",
        "id": 2557,
        "displayName": "Administator",
        "active": true,
        "slug": "admin",
        "type": "NORMAL",
        "links": {
            "self": [
                {
                    "href": "https://example.com/stash/users/admin"
                }
            ]
        }
    },
    "repository": {
        "slug": "todo-app-terraform",
        "id": 1321,
        "name": "todo-app-terraform",
        "scmId": "git",
        "state": "AVAILABLE",
        "statusMessage": "Available",
        "forkable": true,
        "project": {
            "key": "TF",
            "id": 968,
            "name": "terraform iac",
            "description": "terraform iac repositories\r\n\r\n{{platform}}-{{provider}}-{{name}}\r\n\r\nie. `terraform-aws-vpc`",
            "public": false,
            "type": "NORMAL",
            "links": {
                "self": [
                    {
                        "href": "https://example.com/stash/projects/tf"
                    }
                ]
            }
        },
        "public": false,
        "links": {
            "clone": [
                {
                    "href": "ssh://git@example.com/tf/todo-app-terraform.git",
                    "name": "ssh"
                },
                {
                    "href": "https://example.com/stash/scm/tf/todo-app-terraform.git",
                    "name": "http"
                }
            ],
            "self": [
                {
                    "href": "https://example.com/stash/projects/tf/repos/todo-app-terraform/browse"
                }
            ]
        }
    },
    "changes": [
        {
            "ref": {
                "id": "refs/heads/TF-162/feature/keep-history",
                "displayId": "TF-162/feature/keep-history",
                "type": "BRANCH"
            },
            "refId": "refs/heads/TF-162/feature/keep-history",
            "fromHash": "6938f70d438cd8347b272af6e6a8367ed4f70a90",
            "toHash": "18a1bb9180abba73a0f1bf631ace238779feaff0",
            "type": "UPDATE"
        }
    ]
}

@lkysow
Copy link
Member Author

lkysow commented Jan 18, 2020

@kevinneufeld I was referring to the PR:declined payload but thanks!

@kuzm1ch
Copy link
Contributor

kuzm1ch commented Oct 6, 2021

+1 for this issue
 Atlantis version:

runatlantis/atlantis:v0.17.0

log message:

{"level":"debug","ts":*******,"caller":"logging/simple_logger.go:153","msg":"Ignoring unsupported event type repo:refs_changed X-Request-ID=*******","json":{}}

 There is some inconsistency in docs which messed me up.  ddbf967#diff-c3959bd6615407d43d9333fc4daa10006c73dcf006339e61286da34cec197c3bR90

Under **Repository** select **Push**

Push refers to repo:refs_changed which is not supported.

 Push
A user pushes one or more commits to a repository. This payload, with an event key of repo:refs_changed, provides the following fields:

@kuzm1ch
Copy link
Contributor

kuzm1ch commented Jan 25, 2022

Imho, can be closed
69d6fb2 - updated docs

@chenrui333
Copy link
Member

Sounds good, I am closing this issue now. Thanks @kuzm1ch!

jamengual pushed a commit that referenced this issue Nov 23, 2022
meringu pushed a commit to meringu/atlantis that referenced this issue May 29, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature New functionality/enhancement provider/bitbucket
Projects
None yet
Development

No branches or pull requests

7 participants