-
Notifications
You must be signed in to change notification settings - Fork 20
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[CERTTF-303] Introduce support for file attachments (#250)
* [CERTTF-303] Introduce support for file attachments * fix: compatibility with Python 3.8 * chore: correct typos * style: resolve some review comments * refactor: use `data` filter for extracting from archive (superset of `tar`) * chore: add/improve some error handling messages * refactor: introduce `testflinger_agent.config` for configuration constants * refactor: use `tempfile.NamedTemporaryFile` in the CLI for attachments * fix: actually include `testflinger_agent.config` * refactor: use `tempfile` context managers to handle temporary objects in agent * refactor: remove redundant if-statement * feat: CLI retries when submitting attachments * docs: add documentation for attachments * refactor: simplify approach to attachment packing and unpacking * chore: use `sys.exit` instead of raising `SystemExit` in CLI's modified methods * style: improve docstring * style: improve return statement to be more pythonic * fix: correct exponential backoff * refactor: 'get_attachments' method no longer returns anything * fix: make unpacking stricter and ensure recovery in case of failure * fix: add path resolution to attachment packing, to handle dodgy cases * refactor: rename the derived `attachments` field and modify its semantics - the new name is `attachments_status`, to avoid any confusion with the `attachments` field under each phase. - the `attachments_status` field only exists if the job has attachments (instead of having a value of "none" as before) * test: add test for attempting to extract attachments out of phase folder * chore: improve CLI messages in `put_file` in error cases
- Loading branch information
Showing
15 changed files
with
1,075 additions
and
144 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
# Copyright (C) 2024 Canonical | ||
# | ||
# This program is free software: you can redistribute it and/or modify | ||
# it under the terms of the GNU General Public License as published by | ||
# the Free Software Foundation, either version 3 of the License. | ||
# | ||
# This program is distributed in the hope that it will be useful, | ||
# but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
# GNU General Public License for more details. | ||
# | ||
# You should have received a copy of the GNU General Public License | ||
# along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
|
||
"""Configuration constants for the Testflinger agent""" | ||
|
||
ATTACHMENTS_DIR = "attachments" |
Oops, something went wrong.