vyadh / teamcity-deployment-dashboard

A TeamCity dashboard to help summarise what app version has been released to what environment.
Apache License 2.0
26 stars 5 forks source link

Plugin shows only last deploy in last deployed environment #6

Closed bankinobi closed 5 years ago

bankinobi commented 5 years ago

Hello Vyadh!

Its me again.

Still trying to setup you awesome plugin. But i'm stuck again.

Now its shows proper branch that was deployed, but only in last deployed environment For example i deploy BAC-*** branch to 'highload' env: dashboard

After that i deploy master (i aslo tried to deploy the same BAC-*** branch) branch to 'master' env. Now dashboard shows status only for 'master' (last deployed) env. dashboard-1

Project structure looks like this: project_tree

Dashboard enabled for "Deploy" subproject and "hosts" env is configured also here in "Configuration Parameters" Dashboard settings for this project: plugin_settings

Plugin is updated to the last 1.4.0 version.

vyadh commented 5 years ago

Just to check. You're using the same build configuration to deploy, just using different branches?

If so, yes I know why that happens, it's something I've been thinking about. See in the readme under Scenario 2:

Note that the deployments for each environment still currently have to be in separate build configurations and so this scenario will need to used via agent requirements. Ideally this scenario would be more fully supported, but the plugin only gets the last build for any build configuration for efficiency reasons as we cannot query the entire build history to find deployments for each environment. It may be we can use a slower approach via configuration for those that need it.

I've not personally hit this problem as I use separate build configs for each environment, but I agree there is a compelling case to support this.

Maybe the simplest thing would be to have a checkbox in the plugin configuration to "use last build only" or similar, which if you uncheck, it searches the entire build history for deployments (my assumption is that this will be pretty slow if you have many projects and deployments). An improvement on that would be to add a field that allows you to specify how many builds to search.

Ideally this would require no configuration, but don't think I can reasonably tell programmatically when to stop searching.

bankinobi commented 5 years ago

Yes, i'm using one configuration to deploy to different environments, and want to be able to see which branch is currently used on env.

(my assumption is that this will be pretty slow if you have many projects and deployments). An improvement on that would be to add a field that allows you to specify how many builds to search.

Slow but can solve the issue. Currently i just ran out of build configurations, and unfortunately Scenario 2 cant be implemented.

vyadh commented 5 years ago

Yeah, I definitely want to solve this, just couldn't think of a good method for implementing it.

I think what I'll try and do is add a new checkbox to the configuration for "multi environment configurations" that uses a different strategy for searching for builds, where it will deep search the history until builds for all of the configured environments are found.

Hopefully that will slot in fairly easily. We'll see...

vyadh commented 5 years ago

Was a bit more complicated than expected, but this will also allow me to cross off the biggest item on the "Possible Future Features" in the README, which I wasn't going to bother with unless somebody asked for it ;-)

Efficiently look for multiple environment deployments within the same build configuration. Currently we only get the most recent as it's not clear to know when to stop unless we make it configurable. See in TeamCity Project Configuration Scenario #2 above.

Anyway, new functionality appears to work, just doing final testing.

vyadh commented 5 years ago

Try out the new version and let me know if it fixes your problem. You'll have to enable the "Multi-Environment" flag in the settings.