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

Compatibility with scheduled trigger? #8

Closed
westshawn opened this issue Nov 23, 2015 · 17 comments
Closed

Compatibility with scheduled trigger? #8

westshawn opened this issue Nov 23, 2015 · 17 comments

Comments

@westshawn
Copy link

Hi @grundic,

The plugin is fantastic on manual runs!

When I run via scheduled trigger, the web select fields have blank values.

Is it possible to adjust the plugin to support auto-triggered builds?
Or, would that be something JetBrains would need to change in TeamCity?

@grundic
Copy link
Owner

grundic commented Nov 23, 2015

Hello, @westshawn,
Thanks for your response.
Could you please specify, how would you set value to the select box? Should it be hardcoded or you wish to configure it depending on some parameter?
For the first case you can set default value in build parameters.
For the second case I have #5, which I can't resolve yet here is question on JetBrains forum regarding it).

If you still have questions, please feel free to ask me.

@westshawn
Copy link
Author

Hi @grundic,
I would like it to use the first value in the list by default.

My use case is to run the build with the latest version returned by each of several select lists (for multiple web-select parameters).
The web-selects work fine when run manually (custom run; or parameter display=prompt)- I can just leave the first item in the select list selected.
But, when it runs via scheduled trigger (or plain "Run" button with parameter display !=prompt), the value passed to the build for each web-select parameter is blank.

@grundic
Copy link
Owner

grundic commented Nov 23, 2015

@westshawn,
Ok, I got it.
I think it's possible to implement, but I'm in process of moving to another city and accommodating, so not much time left for home projects :)
I'll try my best, but without any promising.

@westshawn
Copy link
Author

@grundic,
Can you describe the area of the code, or type of change you think will allow the build to use the first query item by default?
Maybe I can try implementing it.

Thanks for your work on this, and best of luck with your move!

@grundic
Copy link
Owner

grundic commented Nov 25, 2015

@westshawn,
I'm not sure, but I would start with web/parameters/controller/WebParameterController.java file, add some breakpoints to the methods and investigate the pipeline of the run process.

@westshawn
Copy link
Author

Hi @grundic,
I hope your move went well.

Do you have any plans in the near future to investigate compatibility with scheduled trigger?

@grundic
Copy link
Owner

grundic commented Mar 2, 2016

Hello @westshawn,
Yep, we successfully moved.

I have not much time, but I'll try to implement this feature.

@westshawn
Copy link
Author

Hi @grundic,
Given your other priorities, do you estimate you'll get to it in a matter of days, weeks or months?

@grundic
Copy link
Owner

grundic commented Mar 3, 2016

I would say weeks.
The issue doesn't look very difficult to implement, but I don't have working environment, so it could take some time to configure everything.

grundic pushed a commit that referenced this issue Mar 10, 2016
 Whenever build is triggered it's now possible to provide default value setting one of the options `default` parameter to `true`. Multiple options could be set to default, but only first encountered would be used. Disabled options would be skipped.
@grundic
Copy link
Owner

grundic commented Mar 10, 2016

Hi, I've released a new version of the plugin, so now it should be possible to set default option for using in scheduled trigger:

        {
            "key": "Fifth item",
            "value": "500",
            "enabled": true,
            "default": true
        }

@grundic grundic closed this as completed Mar 10, 2016
@westshawn
Copy link
Author

Molodetz @grundic !
Bolshoe spasibo!

The default values work well with scheduled trigger as well as with the regular "Run" button.

One note that you might consider adding to the documentation is that v1.3 requires TeamCity server to have Java 1.8. Web-parameters v1.2 is compatible with Java 1.7, but v1.3 is not.

I noticed on scheduled builds that used a default value, the value is not displayed on the build run parameters page. The value displayed is blank.

For build runs that used a default web-parameter value, is it possible to display the actual parameter value used by the build on the build parameters page?

Bolshoe spasibo again, this is a great plugin!

@grundic
Copy link
Owner

grundic commented Mar 11, 2016

Пожалуйста! :)
The value is not displayed on parameters page, because it's default value is empty. But you should see actual value of this parameter somewhere below, which should display real value which was used.

@westshawn
Copy link
Author

Okay, that makes sense.
Here is the related issue: https://youtrack.jetbrains.com/issue/TW-20897

@westshawn
Copy link
Author

@grundic,
The functionality for scheduled builds to use the default (first in the list) value works as expected.

A problem we found is that it now uses the default (first in the list) value to override a user selected value as well.

For example:
click "..."
web_select_param

A
B
C

select "B"
click "Run Build"
Click parameters tab on the build run
User Defined Parameters section:

  • web_select_param = B

Actual Parameters on Agent section:

  • web_select_param = A

@grundic
Copy link
Owner

grundic commented Mar 31, 2016

@westshawn, that's strange.. I'll take a look at it soon.

grundic pushed a commit that referenced this issue Apr 11, 2016
 Fix issue when the value was provided by user.
@grundic
Copy link
Owner

grundic commented Apr 11, 2016

@westshawn, hey!
Sorry for long absence... Personal life, work - you know :)
Here you can try release where the issue should be fixed: https://github.com/grundic/teamcity-web-parameters/releases/tag/v1.4.0
As always comments and improvements are welcome!

@westshawn
Copy link
Author

Molodetz @grundic !
v1.4 works as expected for scheduled and manual trigger.

Bolshoe spasibo!

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

No branches or pull requests

2 participants