Project

General

Profile

Actions

action #153763

closed

[regression] Fix dry-run of openqa-investigate size:S

Added by okurz 11 months ago. Updated 11 months ago.

Status:
Resolved
Priority:
Normal
Assignee:
Category:
Regressions/Crashes
Target version:
Start date:
2024-01-17
Due date:
% Done:

0%

Estimated time:

Description

Motivation

From https://suse.slack.com/archives/C02AJ1E568M/p1705482261366879?thread_ts=1705481511.459859&cid=C02AJ1E568M

(Oliver Kurz) maybe changes have broken the dry run
(Tina Müller) yeah, line 161 is doing a openqa-cli POST request and expecting a JSON response. that won't work if it's replaced with an echo

Command-line used:

host=aquarius.suse.cz dry_run=1 exclude_no_group=false ./openqa-investigate 20047

jq (161 ./openqa-investigate): jq: parse error: Invalid numeric literal at line 1, column 11 (rc: 5 Input: >>>openqa-cli api --header User-Agent: openqa-investigate (https://github.com/os-autoinst/scripts) --host https://aquarius.suse.cz --retries=3 -X POST jobs/20047/comments text=Starting investigation for job 20047<<<)

Acceptance Criteria

  • AC1: Dry run does not fail

Suggestions

  • The code is POSTing a comment and then GETting it back, so we need to mock the response(s)
  • Alternatively to mocking, add some input validation to the code block in question and make it do nothing
    • e.g. add an early return in sync_via_investigation_comment() echoing a made-up comment id
  • Add a unit test for it (Test-Driven Development)
  • "dry run" should be understood to potentially read data from external services, but never modify anything or write changes back -> Don't leave behind any traces
    • Consider documenting this somewhere

Related issues 1 (0 open1 closed)

Copied to openQA Project (public) - action #153874: [regression] openqa-investigate post investigate feature is brokenRejected2024-01-17

Actions
Actions #1

Updated by okurz 11 months ago

  • Category changed from Feature requests to Regressions/Crashes
Actions #2

Updated by livdywan 11 months ago

  • Status changed from Workable to New

I don't think this was estimated

Actions #3

Updated by livdywan 11 months ago

  • Subject changed from Fix dry-run of openqa-investigate to [regression] Fix dry-run of openqa-investigate size:S
  • Description updated (diff)
  • Status changed from New to Workable
Actions #4

Updated by jbaier_cz 11 months ago

  • Assignee set to jbaier_cz
Actions #5

Updated by okurz 11 months ago

I have an idea about fixing that. Unless you already did some code changes you can wait and I can prepare a PR. Whatever you prefer.

Actions #6

Updated by jbaier_cz 11 months ago

Go ahead, I did not start yet.

Actions #7

Updated by okurz 11 months ago

  • Status changed from Workable to In Progress
Actions #8

Updated by tinita 11 months ago

  • Copied to action #153874: [regression] openqa-investigate post investigate feature is broken added
Actions #9

Updated by jbaier_cz 11 months ago

  • Status changed from In Progress to Feedback
  • Assignee changed from jbaier_cz to okurz

Is anything else needed here? Looks like we are done here.

Actions #10

Updated by okurz 11 months ago

  • Status changed from Feedback to Resolved

yes, done

Actions

Also available in: Atom PDF