lennybot 1.0.21__py3-none-any.whl → 1.0.25__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,14 +1,14 @@
1
1
  class IAction:
2
2
  @property
3
- def application(self) -> str: # pyright: ignore [reportGeneralTypeIssues]
3
+ def application(self) -> str: # pyright: ignore [reportGeneralTypeIssues, reportReturnType]
4
4
  pass
5
5
 
6
6
  @property
7
- def source_version(self) -> str: # pyright: ignore [reportGeneralTypeIssues]
7
+ def source_version(self) -> str: # pyright: ignore [reportGeneralTypeIssues, reportReturnType]
8
8
  pass
9
9
 
10
10
  @property
11
- def target_version(self) -> str: # pyright: ignore [reportGeneralTypeIssues]
11
+ def target_version(self) -> str: # pyright: ignore [reportGeneralTypeIssues, reportReturnType]
12
12
  pass
13
13
 
14
14
  def run(self):
@@ -118,8 +118,12 @@ class DockerImageAvailableCheck(ICheck):
118
118
 
119
119
  if registry in self._container_config.registries.keys():
120
120
  registry_data = self._container_config.registries[registry]
121
- password = registry_data.password
122
121
  username = registry_data.username
122
+ password = registry_data.password
123
+ if "<REDACTED>" in [username, password]:
124
+ logging.warning(
125
+ "Either username or password contain '<REDACTED>' and probably have not been overwritten"
126
+ )
123
127
  response = requests.get(url, auth=(username, password))
124
128
  else:
125
129
  logging.debug("Registry not found in config")
@@ -139,15 +143,15 @@ class DockerImageAvailableCheck(ICheck):
139
143
  return str(access_token)
140
144
 
141
145
  if response.status_code == 401:
142
- logging.error("Authentication failed:", response.status_code, response.headers)
146
+ logging.error("Authentication failed: %d with %s", response.status_code, response.headers)
143
147
  raise Exception("Error occurred: Unauthenticated: ", response.status_code)
144
148
 
145
149
  if response.status_code == 403:
146
- logging.error("Authorization failed:", response.status_code, response.headers)
150
+ logging.error("Authorization failed: %d with %s", response.status_code, response.headers)
147
151
  raise Exception("Error occurred: Unauthorization: ", response.status_code)
148
152
 
149
153
  if response.status_code == 404:
150
- logging.error("Nothing Found:", response.status_code, response.headers)
154
+ logging.error("Nothing Found: %d with %s", response.status_code, response.headers)
151
155
  raise Exception("Error occurred: Nothing Found: ", response.status_code)
152
156
 
153
157
  raise Exception("Unexpected Status Code", response.status_code)
@@ -176,11 +180,14 @@ class DockerImageAvailableCheck(ICheck):
176
180
 
177
181
  request_url = f"https://{image._registry}/v2/{image._name}/manifests/{image._tag}"
178
182
 
183
+ # depending on the registry it my helps adding the write accept header :)
184
+ # https://github.com/goharbor/harbor/issues/16075
185
+ headers = {
186
+ "Accept": "application/vnd.oci.image.index.v1+json, application/vnd.docker.distribution.manifest.list.v2+json",
187
+ }
179
188
  if access_token is not None:
180
- headers = {"Authorization": f"Bearer {access_token}"}
181
- response = requests.get(request_url, headers=headers)
182
- else:
183
- response = requests.get(request_url)
189
+ headers["Authorization"] = f"Bearer {access_token}"
190
+ response = requests.get(request_url, headers=headers)
184
191
 
185
192
  if response.status_code == 401 and access_token is None:
186
193
  registry = image._registry
lennybot/check/icheck.py CHANGED
@@ -1,15 +1,15 @@
1
1
  class ICheck:
2
2
  @property
3
- def application(self) -> str: # pyright: ignore [reportGeneralTypeIssues]
3
+ def application(self) -> str: # pyright: ignore [reportGeneralTypeIssues, reportReturnType]
4
4
  pass
5
5
 
6
6
  @property
7
- def source_version(self) -> str: # pyright: ignore [reportGeneralTypeIssues]
7
+ def source_version(self) -> str: # pyright: ignore [reportGeneralTypeIssues, reportReturnType]
8
8
  pass
9
9
 
10
10
  @property
11
- def target_version(self) -> str: # pyright: ignore [reportGeneralTypeIssues]
11
+ def target_version(self) -> str: # pyright: ignore [reportGeneralTypeIssues, reportReturnType]
12
12
  pass
13
13
 
14
- def check(self) -> bool: # pyright: ignore [reportGeneralTypeIssues]
14
+ def check(self) -> bool: # pyright: ignore [reportGeneralTypeIssues, reportReturnType]
15
15
  pass
lennybot/model/state.py CHANGED
@@ -13,6 +13,8 @@ class LennyBotState:
13
13
  self._hash = self._calculate_hash()
14
14
  with open(self._filename, encoding="utf-8") as file_ptr:
15
15
  self._data = yaml.safe_load(file_ptr)
16
+ if self._data is None:
17
+ self._data = {}
16
18
 
17
19
  def _init_file(self):
18
20
  if not os.path.exists(self._filename):
@@ -34,7 +34,7 @@ class GitHubService:
34
34
  if self._github is None:
35
35
  raise Exception("GitHub is not configured")
36
36
  repo = self._github.get_repo(self._config.github_pr.repository)
37
- new_pull = repo.create_pull(title, body, repo.default_branch, branch_name)
37
+ new_pull = repo.create_pull(repo.default_branch, branch_name, title=title, body=body)
38
38
  labels = self._get_or_create_labels(repo)
39
39
  new_pull.add_to_labels(*labels)
40
40
  pulls = self._find_own_pulls()
lennybot/service/plan.py CHANGED
@@ -47,7 +47,7 @@ class LennyBotApplication:
47
47
 
48
48
  for check in self._checks:
49
49
  if not check.check():
50
- self._log.info("Check '%s' failed for application '%s'", check.__class__.__name__, self.name)
50
+ self._log.warning("Check '%s' failed for application '%s'", check.__class__.__name__, self.name)
51
51
  return False
52
52
  return True
53
53
 
@@ -1,7 +1,7 @@
1
1
  class ISource:
2
2
  @property
3
- def application(self) -> str: # pyright: ignore [reportGeneralTypeIssues]
3
+ def application(self) -> str: # pyright: ignore [reportGeneralTypeIssues, reportReturnType]
4
4
  pass
5
5
 
6
- def latest_version(self) -> str: # pyright: ignore [reportGeneralTypeIssues]
6
+ def latest_version(self) -> str: # pyright: ignore [reportGeneralTypeIssues, reportReturnType]
7
7
  pass
@@ -0,0 +1 @@
1
+ 1.0.25
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: lennybot
3
- Version: 1.0.21
3
+ Version: 1.0.25
4
4
  Summary: Automatic Updates for Kustomize Resources
5
5
  Home-page: http://github.com/raynigon/lennybot
6
6
  Author: Simon Schneider
@@ -3,34 +3,34 @@ lennybot/__main__.py,sha256=iPpiz09xKqtAjrhONS99OYp6R2dQ6Anbhw1qPIN8ELo,80
3
3
  lennybot/lennybot.py,sha256=6Sm1cvzDkopeqtNEf1RsB-i9CttB94oj4UneZEm3oD4,3790
4
4
  lennybot/actions/__init__.py,sha256=uXIFOBIrTgVF5wIqHIgEgs9l9JrU5gzjdRUQWKsZpGI,1071
5
5
  lennybot/actions/download_resources.py,sha256=tdoidM07SWKRhr3f7yFL7NPtmBS7eDiQvmcIjdCr190,1260
6
- lennybot/actions/iaction.py,sha256=DFj58sGyfVPlBUHdH5P9P6m450MntftHectNQK2qoMI,374
6
+ lennybot/actions/iaction.py,sha256=KR2IkxSNYQc_bKsiKuJjxPr5VTj6dUfB7P1V_uA4yVI,428
7
7
  lennybot/actions/remove_checksums.py,sha256=3GMo_6vDdeBYTG5AYlYHB0iEiqa9tMD4PfIOxOXZ3cE,1797
8
8
  lennybot/actions/update_dockerfile.py,sha256=zkQEmKaIWpECmIwb27moonLJ_7Jr-BBnc6LMrGWo6Rk,1699
9
9
  lennybot/actions/update_image_tag.py,sha256=1XQ40Ls47qDNDair2qyuRWtRYzSNV5tkHGC_yPKY40E,1689
10
10
  lennybot/actions/update_yaml.py,sha256=o7qywAVvDgLcBCYCL4MirmYKduELNemkil7TLxon-BY,1919
11
11
  lennybot/check/__init__.py,sha256=I5Q6bb2zeOX9TDTczsnnFUlQbV5Us5l18LybbNPxhXw,493
12
- lennybot/check/docker_image_available.py,sha256=YDQevan-ewgohuX9nbu9BE3go8xtwupdMyVaLaOWKR4,7751
13
- lennybot/check/icheck.py,sha256=lsHMeZFGNrSM7v-OIOuqn_22osKife62YSp1mRQrGjE,428
12
+ lennybot/check/docker_image_available.py,sha256=LdVyfS-vVmD0FDrvHZNF8qIwkGZRFX3eJrBBxMKujmQ,8224
13
+ lennybot/check/icheck.py,sha256=sCMy1y_rrjVNrKh4vAiHH2QpiZIaUWaF06qkGnyC-N8,500
14
14
  lennybot/config/__init__.py,sha256=L85iDCHQJ1zH6U3s8XJuY3bzpj_r8ZOLm_djv84pG-U,119
15
15
  lennybot/config/config.py,sha256=Z-D_YML-Go3MmcZGN8ij6vdTSPGTNgwCYcK0esGJcLw,11410
16
16
  lennybot/helper/__init__.py,sha256=UxQeNPPeaZm26vc0JPPBhOfXbT1QZysLP_3HLZq8QPs,220
17
17
  lennybot/model/__init__.py,sha256=e_P6FXQooilrRoSKFdewkEUWL8x6k_45lH97yxL1rks,64
18
18
  lennybot/model/plan.py,sha256=KwITeVucCSxjM_SyetyUtGSw8hCXfZqO4yrY-330ba4,1096
19
- lennybot/model/state.py,sha256=Voa45C9FzlY1codE2RwaN-Tg_V2TNPYMJHhE8b2AURA,1394
19
+ lennybot/model/state.py,sha256=UK9ALA3O5tGYQW5WCxQpybHeXrrwrQMgtvoZ4W_N9ok,1453
20
20
  lennybot/service/__init__.py,sha256=jU103QJj6LHYY6-R7wYEdu1oiwRT0FfwLG4wgZYbMAo,96
21
21
  lennybot/service/apply.py,sha256=P-Nkp5zsGRIEt7vkYkNJ_QuBgoN463XvABd5mRUDM0o,695
22
- lennybot/service/github.py,sha256=hO2WkhvTGeQOQg3G7igqSvu3bo_XNM2YHax3a5UDugA,2903
23
- lennybot/service/plan.py,sha256=hFmHVGh6AmVE1bWLSwTASPeN-NAgE9TkBmEG5MKDChY,3130
22
+ lennybot/service/github.py,sha256=bWBUq02_dgDMVXpU9h28-teylNuTf4Ae28EHJ3kByxs,2914
23
+ lennybot/service/plan.py,sha256=x8pzbeK9veaxLox9DoGtLRaUM5O97oMEjz9qkY3iTIM,3133
24
24
  lennybot/service/source/__init__.py,sha256=MX1dINBfsTIv7TDVbX-qbqiMsZN8XM6I4lhudcPnYlM,503
25
- lennybot/service/source/isource.py,sha256=3-34UdP5TZVrcLN85q2RynqVxYVHyL1Wr2BjNaYHj3A,217
25
+ lennybot/service/source/isource.py,sha256=s7T95siVMyKvCX2Ta4O7Jarc5BFAoYWfN74ocyLQiRM,253
26
26
  lennybot/service/source/source_github.py,sha256=z3xV4nH-opDagCGTgCKDjfeGHqbd4kdpmCvk0LCm04w,1073
27
27
  lennybot/service/source/source_github_query.py,sha256=Dn764TBPw6PABhNa_A1JIGCfLoBhcvmScEBHHmCbEbI,1072
28
- lennybot-1.0.21.data/data/generic/README.md,sha256=uNfqoDP3AAZD3AD01JlQ4xje60Se1DgxSFhfJvWHbT0,6228
29
- lennybot-1.0.21.data/data/generic/requirements.txt,sha256=YChJFa4_Okg8UWzn6EPKeMl5gISIZ_k_9sgZSSLycXY,43
30
- lennybot-1.0.21.data/data/generic/version.txt,sha256=jKWo_Fyz5encoM8_aaeZoVpSpjzjPKzt1-pOMe0RmMQ,6
31
- lennybot-1.0.21.dist-info/LICENSE,sha256=xx0jnfkXJvxRnG63LTGOxlggYnIysveWIZ6H3PNdCrQ,11357
32
- lennybot-1.0.21.dist-info/METADATA,sha256=QRKDBKWdrrl-Wi4prjhFplY4AsPQai_vjuH71uGfuuE,7387
33
- lennybot-1.0.21.dist-info/WHEEL,sha256=yQN5g4mg4AybRjkgi-9yy4iQEFibGQmlz78Pik5Or-A,92
34
- lennybot-1.0.21.dist-info/entry_points.txt,sha256=TOjzBcHTJaiBU2arbNIMVr7_clYPAYjBZf5WqiZ8Uhw,43
35
- lennybot-1.0.21.dist-info/top_level.txt,sha256=Hrq9FY_KliVyEMH7LEA9rhCumLFTpKOHdSaZqzfHxhw,9
36
- lennybot-1.0.21.dist-info/RECORD,,
28
+ lennybot-1.0.25.data/data/generic/README.md,sha256=uNfqoDP3AAZD3AD01JlQ4xje60Se1DgxSFhfJvWHbT0,6228
29
+ lennybot-1.0.25.data/data/generic/requirements.txt,sha256=YChJFa4_Okg8UWzn6EPKeMl5gISIZ_k_9sgZSSLycXY,43
30
+ lennybot-1.0.25.data/data/generic/version.txt,sha256=g68-alC5ZPPI3XsrxUra7Vi69ztfWGBJHODg-kMqXc4,6
31
+ lennybot-1.0.25.dist-info/LICENSE,sha256=xx0jnfkXJvxRnG63LTGOxlggYnIysveWIZ6H3PNdCrQ,11357
32
+ lennybot-1.0.25.dist-info/METADATA,sha256=CVgyyGyqhMPMWR7jL969CzTnZNKqrfqc4Kg6fi9D1ZY,7387
33
+ lennybot-1.0.25.dist-info/WHEEL,sha256=GJ7t_kWBFywbagK5eo9IoUwLW6oyOeTKmQ-9iHFVNxQ,92
34
+ lennybot-1.0.25.dist-info/entry_points.txt,sha256=TOjzBcHTJaiBU2arbNIMVr7_clYPAYjBZf5WqiZ8Uhw,43
35
+ lennybot-1.0.25.dist-info/top_level.txt,sha256=Hrq9FY_KliVyEMH7LEA9rhCumLFTpKOHdSaZqzfHxhw,9
36
+ lennybot-1.0.25.dist-info/RECORD,,
@@ -1,5 +1,5 @@
1
1
  Wheel-Version: 1.0
2
- Generator: bdist_wheel (0.41.2)
2
+ Generator: bdist_wheel (0.43.0)
3
3
  Root-Is-Purelib: true
4
4
  Tag: py3-none-any
5
5
 
@@ -1 +0,0 @@
1
- 1.0.21