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

Add workload version to juju status #18

Merged
merged 19 commits into from
Aug 21, 2023
Merged

Conversation

amandahla
Copy link
Collaborator

@amandahla amandahla commented Aug 9, 2023

This PR adds the Synapse version to the workload version so the user can check using the juju status command.
The version can be obtained through a request to the API.

The workload version is set on config-change event for a particular reason: when the charm is deployed, waits for a server_name config. So the user must set by using "juju config synapse server_name=foo". There is a retry configuration because Synapse is restarted after the change.

What happens after merging it:

  • Add docs to metadata
  • Add alive check
  • Add new method to get version
  • Add unit and integration tests

@amandahla amandahla requested a review from a team as a code owner August 9, 2023 21:01
@amandahla amandahla marked this pull request as draft August 9, 2023 21:01
src/synapse/api.py Outdated Show resolved Hide resolved
metadata.yaml Outdated Show resolved Hide resolved
@amandahla amandahla marked this pull request as ready for review August 10, 2023 20:29
@amandahla amandahla changed the title WIP - Add workload version to juju status Add workload version to juju status Aug 10, 2023
src/synapse/api.py Show resolved Hide resolved
src/synapse/workload.py Outdated Show resolved Hide resolved
src/synapse/workload.py Outdated Show resolved Hide resolved
tests/unit/test_synapse_api.py Outdated Show resolved Hide resolved
tests/unit/test_synapse_api.py Outdated Show resolved Hide resolved
tests/unit/test_synapse_api.py Show resolved Hide resolved
src/synapse/api.py Outdated Show resolved Hide resolved
src/synapse/api.py Outdated Show resolved Hide resolved
src/synapse/api.py Outdated Show resolved Hide resolved
src/synapse/api.py Show resolved Hide resolved
src/synapse/api.py Outdated Show resolved Hide resolved
src/synapse/api.py Outdated Show resolved Hide resolved
src/synapse/api.py Outdated Show resolved Hide resolved
src/synapse/api.py Outdated Show resolved Hide resolved
@jdkandersson
Copy link
Contributor

Generally speaking, raising an exception within a function and then handling it within the same function is confusing for the reader and indicates opportunities to improve the error handling flow in a function

src/synapse/api.py Outdated Show resolved Hide resolved
@github-actions
Copy link
Contributor

Test coverage for e7d0af5

Name                            Stmts   Miss Branch BrPart  Cover   Missing
---------------------------------------------------------------------------
src/actions/__init__.py             3      0      0      0   100%
src/actions/register_user.py       20      0      2      0   100%
src/actions/reset_instance.py      21      3      2      1    83%   54-58
src/charm.py                       96      4     10      1    95%   92-93, 154-155
src/charm_state.py                 45      2     10      2    93%   22, 79
src/charm_types.py                  8      0      0      0   100%
src/constants.py                   12      0      0      0   100%
src/database_client.py             53      1     10      3    94%   35, 47->exit, 69->exit
src/database_observer.py           54      4      6      0    93%   70-72, 96
src/exceptions.py                   4      0      0      0   100%
src/observability.py                9      0      0      0   100%
src/pebble.py                      47      0      0      0   100%
src/synapse/__init__.py             3      0      0      0   100%
src/synapse/api.py                 83      2     10      1    97%   138-139
src/synapse/workload.py            94      3     10      1    96%   161, 292-297
src/user.py                        23      0      4      0   100%
---------------------------------------------------------------------------
TOTAL                             575     19     64      9    96%

Static code analysis report

Run started:2023-08-17 13:45:28.490131

Test results:
  No issues identified.

Code scanned:
  Total lines of code: 2590
  Total lines skipped (#nosec): 1
  Total potential issues skipped due to specifically being disabled (e.g., #nosec BXXX): 0

Run metrics:
  Total issues (by severity):
  	Undefined: 0
  	Low: 0
  	Medium: 0
  	High: 0
  Total issues (by confidence):
  	Undefined: 0
  	Low: 0
  	Medium: 0
  	High: 0
Files skipped (0):

@amandahla amandahla merged commit 2856f17 into main Aug 21, 2023
19 checks passed
@amandahla amandahla deleted the ISD-846-synapse-show-version branch August 21, 2023 13:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants