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

Software update plugin: added check_type "bitbucket_commit" #1898

Closed
wants to merge 1 commit into from

Conversation

Projects
None yet
2 participants
@Gallore
Copy link
Contributor

commented May 2, 2017

What does this PR do and why is it necessary?

Adds a new version_check to software update plugin called "bitbucket_commit". It is the same as github_commit but for Bitbucket. With this you're now able to define "bitbucket_commit" as your check type so that software update can find the lastest version of your plugin if it's hosted publicly on Bitbucket.

How was it tested? How can it be tested by the reviewer?

I used this check config:

            "check": {
                "branch": "master",
                "current": "55e4f533e29b52c7efa2cb49763608a0aa3674a2",
                "displayName": "iobeam (DEV)",
                "displayVersion": "0.2.1",
                "pip": "https://bitbucket.org/mrbeam/iobeam/get/{target_version}.zip",
                "pip_command": "sudo /usr/local/bin/pip",
                "repo": "iobeam",
                "type": "bitbucket_commit",
                "user": "mrbeam"

octoprint.log:

2017-05-02 09:38:59,927 - octoprint.plugins.softwareupdate.version_checks.bitbucket_commit - DEBUG - Target: iobeam, local: None, remote: 55e4f533e29b52c7efa2cb49763608a0aa3674a2
...
2017-05-02 12:24:32,052 - octoprint.plugins.softwareupdate - INFO - Starting update of iobeam to 55e4f533e29b52c7efa2cb49763608a0aa3674a2...
2017-05-02 12:24:41,146 - octoprint.plugins.softwareupdate - INFO - Update of iobeam to 55e4f533e29b52c7efa2cb49763608a0aa3674a2 successful!

After the update process OctoPrint showed the correct/new version of the updated component and the commit hash was saved correctly in config.yaml

Notice: The updated component (iobeam) is not an OctoPrint Plugin, it is some random software we use on Mr Beam II

Any background context you want to provide?

More or less I cloned github_commit file in version_checks

What are the relevant tickets if any?

Screenshots (if appropriate)

Further notes

about Bitbucket API:

GET https://api.bitbucket.org/2.0/repositories/mrbeam/iobeam/commit/master
returns this:

{
    "hash": "55e4f533e29b52c7efa2cb49763608a0aa3674a2",
    "repository": {
        "links": {
            "self": {
                "href": "https://api.bitbucket.org/2.0/repositories/mrbeam/iobeam"
            },
            "html": {
                "href": "https://bitbucket.org/mrbeam/iobeam"
            },
            "avatar": {
                "href": "https://bitbucket.org/mrbeam/iobeam/avatar/32/"
            }
        },
        "type": "repository",
        "name": "iobeam",
        "full_name": "mrbeam/iobeam",
        "uuid": "{efe4a865-f57d-4ab5-be71-3e0180c317de}"
    },
    "links": {
        "self": {
            "href": "https://api.bitbucket.org/2.0/repositories/mrbeam/iobeam/commit/55e4f533e29b52c7efa2cb49763608a0aa3674a2"
        },
        "comments": {
            "href": "https://api.bitbucket.org/2.0/repositories/mrbeam/iobeam/commit/55e4f533e29b52c7efa2cb49763608a0aa3674a2/comments"
        },
        "patch": {
            "href": "https://api.bitbucket.org/2.0/repositories/mrbeam/iobeam/patch/55e4f533e29b52c7efa2cb49763608a0aa3674a2"
        },
        "html": {
            "href": "https://bitbucket.org/mrbeam/iobeam/commits/55e4f533e29b52c7efa2cb49763608a0aa3674a2"
        },
        "diff": {
            "href": "https://api.bitbucket.org/2.0/repositories/mrbeam/iobeam/diff/55e4f533e29b52c7efa2cb49763608a0aa3674a2"
        },
        "approve": {
            "href": "https://api.bitbucket.org/2.0/repositories/mrbeam/iobeam/commit/55e4f533e29b52c7efa2cb49763608a0aa3674a2/approve"
        },
        "statuses": {
            "href": "https://api.bitbucket.org/2.0/repositories/mrbeam/iobeam/commit/55e4f533e29b52c7efa2cb49763608a0aa3674a2/statuses"
        }
    },
    "author": {
        "raw": "Andy Werner <andy@mr-beam.org>",
        "user": {
            "username": "Gallore",
            "display_name": "Andy Werner",
            "type": "user",
            "uuid": "{ec9c41d3-88e1-43aa-88fd-60a29c3ac45e}",
            "links": {
                "self": {
                    "href": "https://api.bitbucket.org/2.0/users/Gallore"
                },
                "html": {
                    "href": "https://bitbucket.org/Gallore/"
                },
                "avatar": {
                    "href": "https://bitbucket.org/account/Gallore/avatar/32/"
                }
            }
        }
    },
    "participants": [

    ],
    "parents": [
        {
            "hash": "6a3d925ecd8e95b1dc4994e62433ab73a1e91d0e",
            "type": "commit",
            "links": {
                "self": {
                    "href": "https://api.bitbucket.org/2.0/repositories/mrbeam/iobeam/commit/6a3d925ecd8e95b1dc4994e62433ab73a1e91d0e"
                },
                "html": {
                    "href": "https://bitbucket.org/mrbeam/iobeam/commits/6a3d925ecd8e95b1dc4994e62433ab73a1e91d0e"
                }
            }
        }
    ],
    "date": "2017-04-27T17:57:03+00:00",
    "message": "Moved ping logic into iobeam.py, added sleep time\n",
    "type": "commit"
}

foosel added a commit that referenced this pull request May 2, 2017

@foosel

This comment has been minimized.

Copy link
Owner

commented May 3, 2017

Nearly forgot: cherry picked on maintenance as fe0aa03 and hence merged, will be part of 1.3.2. Closing manually because Github doesn't detect that cherry pick.

@foosel foosel closed this May 3, 2017

foosel added a commit that referenced this pull request May 11, 2017

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.