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

Create workitem of type 'Epic' - HTTP 404 #90

Closed
Mershl opened this issue Jun 2, 2017 · 12 comments
Closed

Create workitem of type 'Epic' - HTTP 404 #90

Mershl opened this issue Jun 2, 2017 · 12 comments
Assignees
Labels
Milestone

Comments

@Mershl
Copy link

Mershl commented Jun 2, 2017

Hi @dixudx

When trying to create a workitem with a task_type of 'Epic' the task_type will be found by projectarea.getItemType(item_type) but on creation it will report:

requests.exceptions.HTTPError: 404 Client Error: Not Found for url: https://<jazzhost>/ccm/oslc/contexts/_qi848CJaEeSy9NmiE0zU4Q/workitems/com.ibm.team.apt.workitemtype.epic

In the log it's visible as:

<oslc_cm:status>404</oslc_cm:status>
<oslc_cm:message>Not found: com.ibm.team.apt.workitemtype.epic</oslc_cm:message>
</oslc_cm:error>
@dixudx
Copy link
Owner

dixudx commented Jun 2, 2017

@Mershl Can you successfully create an Epic from the web UI ?

@Mershl
Copy link
Author

Mershl commented Jun 2, 2017

@dixudx Yes, just tested. Is the service url provided by the service catalog possibly wrong?

dixudx added a commit that referenced this issue Jun 2, 2017
@dixudx dixudx self-assigned this Jun 2, 2017
@dixudx dixudx added the kind/bug label Jun 2, 2017
@dixudx dixudx added this to the 0.7.0 milestone Jun 2, 2017
@dixudx
Copy link
Owner

dixudx commented Jun 2, 2017

@Mershl Sorry, it's my mistake. This bug was involved by issue #88. Already fix that. Please have another try.

@Mershl
Copy link
Author

Mershl commented Jun 16, 2017

@dixudx Thanks for the update. I've cut down my implementation to a minimum example (basically just calling createWorkitem with a type, title, description, PA and a copied_from task).
For type 'Task' and 'Epic' _createWorkitem raises Client Error 409:

requests.exceptions.HTTPError: 409 Client Error: Conflict for url: https://<jazzhost>/ccm/oslc/contexts/_2oS9cE8nEeaEVMF1sYTWPA/workitems/task

Tested using latest version of 'development' branch.

@dixudx
Copy link
Owner

dixudx commented Jun 17, 2017

@Mershl I retested the latest code of branch development. It works well on Task and Epic.

my_rtc = RTCClient(.....)
new_workitem = my_rtc.createWorkitem("Epic", "client test", "test desc", "_73iaQFM1EeeSvaa7xqfEqw", copied_from=9, keep=True)

Please pull the latest code and retry.

If still the same error, please paste your sample workitem (already created successfully) xml here. We may need to compare the item type.

@Mershl
Copy link
Author

Mershl commented Jun 19, 2017

Hi @dixudx, I found the culprit. I get a

requests.exceptions.HTTPError: 409 Client Error: Conflict for url: https://<jazzhost>/ccm/oslc/contexts/_2oS9cE8nEeaEVMF1sYTWPA/workitems/task

if I set keep=False when creating an Epic. Leaving it at True will create the Epic as intended.

@dixudx
Copy link
Owner

dixudx commented Jun 19, 2017

@Mershl Glad to see it works on your environment. Good job.

Actually you should copy from a workitem with same type. Because different workitems tend to have different attributes, which may result in such occurrences.

@Mershl
Copy link
Author

Mershl commented Jun 19, 2017

@dixudx How long does it usually take you to create an Epic/Task? Creating an Epic takes about 43 seconds and a Task averages at 40 seconds per creation on my two tested RTC installations.

@dixudx
Copy link
Owner

dixudx commented Jun 19, 2017

@Mershl Just a few seconds. Before posting request to create new workitem, the client will try to fetch some metadata to copy into the post body, which will take several seconds.

In general, it takes about 5-6 seconds.

@Mershl
Copy link
Author

Mershl commented Jun 19, 2017

The problem is solved. Just one last question @dixudx. Have you ever tried calling Create in a thread pool. I have additional parameters that lead to a creation of ~40s. Using multithreads it should be possible to mititgate the scaling of this time for 10 WorkItem creations.

@dixudx
Copy link
Owner

dixudx commented Jun 19, 2017

@Mershl Good question.

Actually using multithread will bring some benefits, mainly saving time. But RTC is mainly for project managements. Time efficiency is not that significant. Also the code structure, asynchronous callings and etc will make the library complicated and error-prone.

If we want to create tens of workitems simultaneously, we can just call createWorkitem in threading.Thread instead of creating one by one.

@Mershl
Copy link
Author

Mershl commented Jun 20, 2017

Thanks @dixudx. Using threads it's possible to create 10 (and possibily more) Workitems at a time.

Creating 10 tasks sequentially: 430 seconds
Creating 10 tasks in parallel: 62 seconds
(Tasks include many custom attributes)

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

No branches or pull requests

2 participants