In 39a62f7a1 we started relying on exporting the output from
resultsdb_directive and forwarding it to other directives
(bodhi_comments_directive). That breaks if reporting to ResultsDB is
disabled. This patch fixes that.
Details
test suite works, and my manual task execution as well (with bodhi comments enabled, but resultsdb reporting disabled)
Diff Detail
- Repository
- rLTRN libtaskotron
- Lint
Automatic diff as part of commit; lint not applicable. - Unit
Automatic diff as part of commit; unit tests not applicable.
Looks like it'll work but wouldn't it be better if we replicated the return statement that's used if resultsdb reporting is enabled instead of doing something different? The check detail objects aren't altered during the reporting process and they're already constructed bythe time that we get to the return statements
libtaskotron/directives/resultsdb_directive.py | ||
---|---|---|
211 | Why return the input data here instead of replicating the return check.export_TAP(check_details) call that's made if resultsdb reporting is enabled? |
libtaskotron/directives/resultsdb_directive.py | ||
---|---|---|
211 | My original (very quick) thought was that when reporting is disabled, I'd return the raw unaltered input data, behaving as a "no-op" operation. If I import and re-export TAP, I'll return different data (reordered, reformatted, unknown fields ignored). I'd be basically sanitizing the data to some extent. But thinking about it more, it's probably somewhat weird for this directive to return sometimes raw input content, and sometimes sanitized content, depending on results having been reported or not. Consistent output behavior (sans the result id field) seems like a better thing to do. Good point. I'll adjust accordingly. |
Why return the input data here instead of replicating the return check.export_TAP(check_details) call that's made if resultsdb reporting is enabled?