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

Missing changes for the lobster-codebeamer supports query string argument #158

Merged
merged 1 commit into from
Dec 17, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

### 0.9.21-dev

* `lobster-codebeamer` now supports query string, query string (CBQL) can be passed
* `lobster-codebeamer` now supports query string, query string (cbQL) can be passed
as a command line argument to the tool `lobster-codebeamer`.

* `lobster-html-report` has the following updates.
Expand Down
26 changes: 11 additions & 15 deletions lobster/tools/codebeamer/codebeamer.py
Original file line number Diff line number Diff line change
Expand Up @@ -170,8 +170,10 @@ def get_query(mh, cb_config, query):
page_id,
cb_config["page_size"]))
elif isinstance(query, str):
url = ("%s/items/query?queryString=%s" %
url = ("%s/items/query?page=%u&pageSize=%u&queryString=%s" %
(cb_config["base"],
page_id,
cb_config["page_size"],
query))
data = query_cb_single(cb_config, url)
assert len(data) == 4
Expand Down Expand Up @@ -535,28 +537,22 @@ def main():

elif options.import_query:
try:
if isinstance(options.import_query, int):
query = int(options.import_query)
if query < 1:
ap.error("query_string must be a positive integer")
elif isinstance(options.import_query, str):
if options.import_query.startswith("-"):
ap.error("query_string must be a positive integer"
" or valid string")
if isinstance(options.import_query, str):
if (options.import_query.startswith("-") and
options.import_query[1:].isdigit()):
ap.error("import-query must be a positive integer")
elif options.import_query.startswith("-"):
ap.error("import-query must be a valid cbQL query")
elif options.import_query.isdigit():
query = int(options.import_query)
if query < 1:
ap.error("query_string must be a positive integer")
else:
query = str(options.import_query)
options.import_query = int(options.import_query)
except ValueError as e:
ap.error(str(e))

try:
if options.import_tagged:
items = import_tagged(mh, cb_config, items_to_import)
elif options.import_query:
items = get_query(mh, cb_config, query)
items = get_query(mh, cb_config, options.import_query)
except LOBSTER_Error:
return 1

Expand Down
Loading