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

Governor Redmine #16

Closed
wants to merge 29 commits into from
Closed

Governor Redmine #16

wants to merge 29 commits into from

Conversation

rmpestano
Copy link
Contributor

Created redmine sub project.

It Adds the ability to manage Redmine issues through Arquillian governor.

@smiklosovic
Copy link
Member

Yay! Awesome job! I'll look at this today :)


To use this extension you need to enable Redmine rest api like in image below:

image::https://raw.githubusercontent.com/rmpestano/arquillian-governor/master/redmine/enable-api.png[]
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

please commit these images to this repository as well and link them

// edit

I see you have commited them to repository but these URLs are still pointing to your fork instead of this repository once it is merged.

@smiklosovic
Copy link
Member

Thanks for this PR a lot! I do not mind to merge it once some cosmetic changes are done to the code.

Please use this code formatter in your favorite IDE to make sure code is consistent accross the project. The only change to that coding style is that braces are put on new line. It can be easilly overridden in the IDE settings.

https://github.com/jboss/ide-config

- added license
- removed temp file (~pom.xml)
@rmpestano
Copy link
Contributor Author

Hi @smiklosovic, thanks for reviewing it.

There is something where I need some help here.

I wanted to add the ability to re open issues to governor redmine when a test related to a closed issue fails.

The problem is that when a test fails I receive testResult status == PASSED in execution decided here.

Do you have any idea why this is happening?

@smiklosovic
Copy link
Member

@rmpestano

Honestly I do not know. That is something what @aslakknutsen could elaborate on. I was always thinking that when you recieve "After" event, the test result is fully populated / initialized to reflect it.

I think that we have seen this some time ago.

Please try to update Arquillian to 1.1.10.Final but that should not change a thing.

@rmpestano
Copy link
Contributor Author

@smiklosovic I'll take a look but I remember the problem with 'false' test result was in 1.1.4.

About the code conventions and the brackets in new line I could not meke it work in IDEA (14.1.5) neither in eclipse (mars). In IDEA there is no 'In IDEA go to File -> Settings -> Import Settings' menu and in Eclipse the template has no effect. I will take a look at home later. Thank you so far.

@rmpestano
Copy link
Contributor Author

Listening to AfterTestLifecycleEvent also didnt helped:

after_test_lifecycle

lets see what Aslak has to say

@rmpestano
Copy link
Contributor Author

well it is just working, the only strange thing is that the AfterTestLifecycleEvent is called two times, one with testResult Status.PASSED and another with FAILED, in the end it behaved as I expected and the issue was reopened:

openclosed

@rmpestano
Copy link
Contributor Author

@smiklosovic, I see. I am also checking if the issue isn't closed (or opened) to decide if I update it.

An issue I'm facing now is related to Redmine itself. We can have workflows for issue statuses transition so for example here at the company we can't close an issue directly, we have first to set its status to 'execution' and then we are able to close.

The problem is that redmine rest api doesn't provide information about workflow, see here.

I am thinking in provide a property at arquillian.xml so user can define the close workflow, somethink like:

<extension qualifier="governor-redmine">
        <property name="closeStatusWorkflow">2,5</property>
    </extension>

this means that issue will be updated to status 2(execution) and 5(closed). Its not ideal cause developer must know the status ids (it can be found in the redmineURL/issue_statuses.xml).

I think Jira has something similar but as I see it has an api for issue transitions.

What do you think?

@smiklosovic
Copy link
Member

@rmpestano could not you parse that issue_statuses.xml directly to know the status so developer himself does not have to do that?

@rmpestano
Copy link
Contributor Author

I can (it is in the REST api) but I'm not sure how it could help cause the main problem is the status update order. In the above example it was 2, 5 but it could be 2, 4, 8 , 5 and so on. It depends on how redmine was configured. Só somehow developer will have to provide that status transition order (he will know cause it is the sane status order he updates issues through redmine web application).

@rmpestano
Copy link
Contributor Author

Or you mean just to print in the logs all available status and its ids at test startup?

@smiklosovic
Copy link
Member

i dont know ... do it in the way it is the most comfortable and viable for you. I will merge it anyway

@rmpestano
Copy link
Contributor Author

Hi again,

  • I've added closeOrder to support customized redmine issue workflows;
  • I had to add some logic to skip first 'after' event as Aslak comented above. We have to see if github and jira also doesnt suffer from this.

The only problem now is the code style, I still cannot apply jboss formater here, look my eclipse(developer studio 8.1.0) config:

formatter

@rmpestano
Copy link
Contributor Author

Hi @smiklosovic,

just confirmed that github governor also suffers from the multiple event calling, see #17.

@rmpestano
Copy link
Contributor Author

I have commited the fix for github governor and it is incorporated in this PR. Don't know if it should be in this PR.

@smiklosovic
Copy link
Member

thanks! i will return to this on 27th of december, merry christmas!

@smiklosovic
Copy link
Member

what about jira?

@smiklosovic
Copy link
Member

dont worry about codestyle, i will format it before squash and merge

skipping first 'fake' after event call for Jira governor
@rmpestano
Copy link
Contributor Author

yea same for jira, applyed the same fix.

merry christmas!

@rmpestano
Copy link
Contributor Author

Hi @smiklosovic,

now I think we are ready.

Besides adding governor Redmine, this PR solves #19 and #20.

#19 affected only github and #20 afected both github and jira.

@smiklosovic
Copy link
Member

I cherry-picked your last commits and squashed them on top of already-merged master

Thanks! You can expect release soon.

@rmpestano
Copy link
Contributor Author

👍

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

Successfully merging this pull request may close these issues.

None yet

3 participants