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

Add support for Octopus Spaces #112

Open
ryanrousseau opened this issue Oct 26, 2020 · 1 comment
Open

Add support for Octopus Spaces #112

ryanrousseau opened this issue Oct 26, 2020 · 1 comment
Assignees
Labels
feature New feature or request

Comments

@ryanrousseau
Copy link
Contributor

Octopus Deploy introduced Spaces in 2019.1. Projects belong to a single space and each space has its own dashboard.

Describe the solution you'd like
I'd like to be able to specify the space that the Octopus collector should collect from. If the spaceId is provided, the API calls and task links will be updated to include the ID.

If spaceId is not provided, nothing is added to the requests. If no space ID is provided to Octopus, it will use the Default Space unless it has been disabled. If someone has disabled their default space, the spaceId will be required for every space.

        {
            "octopus": {
                "id": "octopus_default_space",
                "serverUrl": "https://localhost:9000",
                "credentials": {
                    "apiKey": "${OCTOPUS_API_KEY}"
                },
                "projects": [
                    {
                        "projectId": "Project-1",
                        "environments": [
                            "Environments-1",
                            "Environments-2"
                        ]
                    }
                ]
            }
        },
        {
            "octopus": {
                "id": "octopus_sandbox_space",
                "serverUrl": "https://localhost:9000",
                "credentials": {
                    "apiKey": "${OCTOPUS_API_KEY}"
                },
                "projects": [
                    {
                        "projectId": "Project-1",
                        "environments": [
                            "Environments-1",
                            "Environments-2"
                        ]
                    }
                ],
                "spaceId": "Spaces-2"
            }
        },

Describe alternatives you've considered

I did consider putting multiple spaces in a single collector definition (example below) so that one collector could serve from multiple spaces. This seems messier and would be a breaking change for existing Octopus collectors. It also wouldn't work for Octopus servers older than 2019.1 without some way to list projects without a space.

        {
            "octopus": {
                "id": "octopus_local",
                "serverUrl": "https://localhost:9000",
                "credentials": {
                    "apiKey": "${OCTOPUS_API_KEY}"
                },
                "spaces": [
                    {
                        "spaceId": "Spaces-1",
                        "projects": [
                            {
                                "projectId": "Project-1",
                                "environments": [
                                    "Environments-1",
                                    "Environments-2"
                                ]
                            }
                        ]
                    },
                    {
                        "spaceId": "Spaces-2",
                        "projects": [
                            {
                                "projectId": "Project-2",
                                "environments": [
                                    "Environments-3",
                                    "Environments-4"
                                ]
                            }
                        ]
                    }
                ]
            }
        },

While it could be convenient to define multiple spaces in one collector, I don't think enforcing one collector per space is that much of a hurdle for users.

Additional context

I'd like to try my hand at implementing whichever version is approved.

@ryanrousseau ryanrousseau added the feature New feature or request label Oct 26, 2020
@patriksvensson
Copy link
Member

@ryanrousseau I think this is an excellent idea. Looking forward to the pull request 😄

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants