Skip to content

Commit

Permalink
Missing changes for the lobster-codebeamer supports query string argu…
Browse files Browse the repository at this point in the history
…ment

GitHub issue: #87
  • Loading branch information
mugdhadhole1 committed Dec 16, 2024
1 parent c28d1bb commit 8583e2a
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 12 deletions.
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
19 changes: 8 additions & 11 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,18 +537,13 @@ 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)
except ValueError as e:
Expand Down

0 comments on commit 8583e2a

Please sign in to comment.