gitops 1.2.0__tar.gz → 1.3.1__tar.gz

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.
Files changed (81) hide show
  1. {gitops-1.2.0 → gitops-1.3.1}/.release-please-manifest.json +1 -1
  2. {gitops-1.2.0 → gitops-1.3.1}/CHANGELOG.md +15 -0
  3. {gitops-1.2.0 → gitops-1.3.1}/PKG-INFO +1 -1
  4. {gitops-1.2.0 → gitops-1.3.1}/gitops/__init__.py +1 -1
  5. {gitops-1.2.0 → gitops-1.3.1}/gitops/core.py +5 -1
  6. gitops-1.3.1/gitops_server/version.py +1 -0
  7. {gitops-1.2.0 → gitops-1.3.1}/gitops_server/workers/deployer/deploy.py +5 -0
  8. {gitops-1.2.0 → gitops-1.3.1}/pyproject.toml +1 -1
  9. {gitops-1.2.0 → gitops-1.3.1}/tests/sample_data.py +189 -0
  10. {gitops-1.2.0 → gitops-1.3.1}/tests/test_deploy.py +17 -1
  11. gitops-1.2.0/gitops_server/version.py +0 -1
  12. {gitops-1.2.0 → gitops-1.3.1}/.dockerignore +0 -0
  13. {gitops-1.2.0 → gitops-1.3.1}/.github/workflows/release-please.yaml +0 -0
  14. {gitops-1.2.0 → gitops-1.3.1}/.github/workflows/test.yml +0 -0
  15. {gitops-1.2.0 → gitops-1.3.1}/.gitignore +0 -0
  16. {gitops-1.2.0 → gitops-1.3.1}/.mise.toml +0 -0
  17. {gitops-1.2.0 → gitops-1.3.1}/.pre-commit-config.yaml +0 -0
  18. {gitops-1.2.0 → gitops-1.3.1}/Dockerfile +0 -0
  19. {gitops-1.2.0 → gitops-1.3.1}/LICENSE +0 -0
  20. {gitops-1.2.0 → gitops-1.3.1}/README.md +0 -0
  21. {gitops-1.2.0 → gitops-1.3.1}/charts/gitops/.helmignore +0 -0
  22. {gitops-1.2.0 → gitops-1.3.1}/charts/gitops/CHANGELOG.md +0 -0
  23. {gitops-1.2.0 → gitops-1.3.1}/charts/gitops/Chart.yaml +0 -0
  24. {gitops-1.2.0 → gitops-1.3.1}/charts/gitops/README.md +0 -0
  25. {gitops-1.2.0 → gitops-1.3.1}/charts/gitops/templates/_helpers.tpl +0 -0
  26. {gitops-1.2.0 → gitops-1.3.1}/charts/gitops/templates/certificate.yml +0 -0
  27. {gitops-1.2.0 → gitops-1.3.1}/charts/gitops/templates/deployment.yml +0 -0
  28. {gitops-1.2.0 → gitops-1.3.1}/charts/gitops/templates/environment.yml +0 -0
  29. {gitops-1.2.0 → gitops-1.3.1}/charts/gitops/templates/ingress.yml +0 -0
  30. {gitops-1.2.0 → gitops-1.3.1}/charts/gitops/templates/issuer.yml +0 -0
  31. {gitops-1.2.0 → gitops-1.3.1}/charts/gitops/templates/secrets.yml +0 -0
  32. {gitops-1.2.0 → gitops-1.3.1}/charts/gitops/templates/service.yml +0 -0
  33. {gitops-1.2.0 → gitops-1.3.1}/charts/gitops/templates/serviceaccount.yaml +0 -0
  34. {gitops-1.2.0 → gitops-1.3.1}/charts/gitops/values.yaml +0 -0
  35. {gitops-1.2.0 → gitops-1.3.1}/docker-compose.yml +0 -0
  36. {gitops-1.2.0 → gitops-1.3.1}/gitops/common/__init__.py +0 -0
  37. {gitops-1.2.0 → gitops-1.3.1}/gitops/common/app.py +0 -0
  38. {gitops-1.2.0 → gitops-1.3.1}/gitops/common/utils.py +0 -0
  39. {gitops-1.2.0 → gitops-1.3.1}/gitops/main.py +0 -0
  40. {gitops-1.2.0 → gitops-1.3.1}/gitops/py.typed +0 -0
  41. {gitops-1.2.0 → gitops-1.3.1}/gitops/settings.py +0 -0
  42. {gitops-1.2.0 → gitops-1.3.1}/gitops/shorthands.py +0 -0
  43. {gitops-1.2.0 → gitops-1.3.1}/gitops/utils/__init__.py +0 -0
  44. {gitops-1.2.0 → gitops-1.3.1}/gitops/utils/apps.py +0 -0
  45. {gitops-1.2.0 → gitops-1.3.1}/gitops/utils/async_runner.py +0 -0
  46. {gitops-1.2.0 → gitops-1.3.1}/gitops/utils/cli.py +0 -0
  47. {gitops-1.2.0 → gitops-1.3.1}/gitops/utils/exceptions.py +0 -0
  48. {gitops-1.2.0 → gitops-1.3.1}/gitops/utils/images.py +0 -0
  49. {gitops-1.2.0 → gitops-1.3.1}/gitops/utils/kube.py +0 -0
  50. {gitops-1.2.0 → gitops-1.3.1}/gitops/utils/tags.py +0 -0
  51. {gitops-1.2.0 → gitops-1.3.1}/gitops/utils/yaml.py +0 -0
  52. {gitops-1.2.0 → gitops-1.3.1}/gitops_server/CHANGELOG.md +0 -0
  53. {gitops-1.2.0 → gitops-1.3.1}/gitops_server/README.md +0 -0
  54. {gitops-1.2.0 → gitops-1.3.1}/gitops_server/__init__.py +0 -0
  55. {gitops-1.2.0 → gitops-1.3.1}/gitops_server/app.py +0 -0
  56. {gitops-1.2.0 → gitops-1.3.1}/gitops_server/main.py +0 -0
  57. {gitops-1.2.0 → gitops-1.3.1}/gitops_server/settings.py +0 -0
  58. {gitops-1.2.0 → gitops-1.3.1}/gitops_server/types.py +0 -0
  59. {gitops-1.2.0 → gitops-1.3.1}/gitops_server/utils/__init__.py +0 -0
  60. {gitops-1.2.0 → gitops-1.3.1}/gitops_server/utils/git.py +0 -0
  61. {gitops-1.2.0 → gitops-1.3.1}/gitops_server/utils/github.py +0 -0
  62. {gitops-1.2.0 → gitops-1.3.1}/gitops_server/utils/slack.py +0 -0
  63. {gitops-1.2.0 → gitops-1.3.1}/gitops_server/workers/__init__.py +0 -0
  64. {gitops-1.2.0 → gitops-1.3.1}/gitops_server/workers/deployer/__init__.py +0 -0
  65. {gitops-1.2.0 → gitops-1.3.1}/gitops_server/workers/deployer/hooks.py +0 -0
  66. {gitops-1.2.0 → gitops-1.3.1}/gitops_server/workers/deployer/worker.py +0 -0
  67. {gitops-1.2.0 → gitops-1.3.1}/release-please-config.json +0 -0
  68. {gitops-1.2.0 → gitops-1.3.1}/release.py +0 -0
  69. {gitops-1.2.0 → gitops-1.3.1}/ruff.toml +0 -0
  70. {gitops-1.2.0 → gitops-1.3.1}/secrets.example.env +0 -0
  71. {gitops-1.2.0 → gitops-1.3.1}/setup.cfg +0 -0
  72. {gitops-1.2.0 → gitops-1.3.1}/tests/__init__.py +0 -0
  73. {gitops-1.2.0 → gitops-1.3.1}/tests/conftest.py +0 -0
  74. {gitops-1.2.0 → gitops-1.3.1}/tests/test_app.py +0 -0
  75. {gitops-1.2.0 → gitops-1.3.1}/tests/test_core.py +0 -0
  76. {gitops-1.2.0 → gitops-1.3.1}/tests/test_git.py +0 -0
  77. {gitops-1.2.0 → gitops-1.3.1}/tests/test_gitops_server.py +0 -0
  78. {gitops-1.2.0 → gitops-1.3.1}/tests/test_utils.py +0 -0
  79. {gitops-1.2.0 → gitops-1.3.1}/tests/utils.py +0 -0
  80. {gitops-1.2.0 → gitops-1.3.1}/tests/webhook_sample_data.py +0 -0
  81. {gitops-1.2.0 → gitops-1.3.1}/uv.lock +0 -0
@@ -1,5 +1,5 @@
1
1
  {
2
- ".": "1.2.0",
2
+ ".": "1.3.1",
3
3
  "gitops_server": "0.15.1",
4
4
  "charts/gitops": "1.1.2"
5
5
  }
@@ -1,5 +1,20 @@
1
1
  # Changelog
2
2
 
3
+ ## [1.3.1](https://github.com/uptick/gitops/compare/gitops-v1.3.0...gitops-v1.3.1) (2025-04-14)
4
+
5
+
6
+ ### Bug Fixes
7
+
8
+ * **git:** correctly retry on failed git push ([b0f6181](https://github.com/uptick/gitops/commit/b0f6181b72229998777d65529e6e67735f5977c2))
9
+
10
+ ## [1.3.0](https://github.com/uptick/gitops/compare/gitops-v1.2.0...gitops-v1.3.0) (2025-03-25)
11
+
12
+
13
+ ### Features
14
+
15
+ * **cli:** add skip deploy to gitops bump ([554b0a5](https://github.com/uptick/gitops/commit/554b0a5adf5dbea0f0ac3d020ac65aa1e3c831bd))
16
+ * **server:** skip deployment if --skip-deploy is present ([2cd9c16](https://github.com/uptick/gitops/commit/2cd9c16ab618d13660b5ef17079e39bbcd02d956))
17
+
3
18
  ## [1.2.0](https://github.com/uptick/gitops/compare/gitops-v1.1.2...gitops-v1.2.0) (2025-03-17)
4
19
 
5
20
 
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: gitops
3
- Version: 1.2.0
3
+ Version: 1.3.1
4
4
  Summary: Manage multiple apps across one or more k8s clusters.
5
5
  Author-email: Jarek Głowacki <jarekwg@gmail.com>
6
6
  License-File: LICENSE
@@ -6,7 +6,7 @@ from gitops.utils.apps import App, get_app_details, get_apps
6
6
 
7
7
  from .utils.cli import success, warning
8
8
 
9
- __version__ = "1.2.0"
9
+ __version__ = "1.3.1"
10
10
 
11
11
 
12
12
  # Checking gitops version matches cluster repo version.
@@ -42,6 +42,7 @@ def bump( # noqa: C901
42
42
  push=False,
43
43
  redeploy=False,
44
44
  skip_migrations=False,
45
+ skip_deploy=False,
45
46
  ):
46
47
  """Bump image tag on selected app(s).
47
48
  Provide `image_tag` to set to a specific image tag, or provide `prefix` to use latest image
@@ -50,6 +51,7 @@ def bump( # noqa: C901
50
51
  Provide `push` to automatically push the commit (and retry on conflict.)
51
52
  Provide `redeploy` to redeploy servers even if nothing has changed.
52
53
  Provide `skip_migrations` to disable running migrations via helm hooks.
54
+ Provide `skip_deploy` to skip deploying for non functional changes.
53
55
  """
54
56
  prompt_message = "The following apps will have their image bumped"
55
57
  if image_tag:
@@ -119,6 +121,8 @@ def bump( # noqa: C901
119
121
  commit_message += f" to use prefix {prefix}"
120
122
  if skip_migrations:
121
123
  commit_message += " --skip-migrations"
124
+ if skip_deploy:
125
+ commit_message += " --skip-deploy"
122
126
 
123
127
  run(f'cd {get_apps_directory()}; git commit -am "{commit_message}."')
124
128
 
@@ -372,7 +376,7 @@ def git_push(cluster_path: str, retry: int = 3):
372
376
  attempts = 0
373
377
  while attempts <= retry:
374
378
  result = run(f"cd {cluster_path}; git push", warn=True)
375
- if result and result.exited == 1 and "remote contains work" in result.stderr:
379
+ if result is not None and result.exited == 1 and "remote contains work" in result.stderr:
376
380
  attempts += 1
377
381
  run(f"cd {cluster_path}; git pull --rebase=true")
378
382
  else:
@@ -0,0 +1 @@
1
+ __version__ = "1.3.1"
@@ -70,6 +70,7 @@ class Deployer:
70
70
  self.failed_apps: set[str] = set()
71
71
 
72
72
  self.post_ts: str | None = None
73
+ self.skip_deploy = "--skip-deploy" in commit_message
73
74
 
74
75
  @classmethod
75
76
  async def from_push_event(cls, push_event):
@@ -94,6 +95,10 @@ class Deployer:
94
95
  )
95
96
 
96
97
  async def deploy(self):
98
+ if self.skip_deploy:
99
+ logger.info("Skipping deploy due to `--skip-deploy` flag.")
100
+ return
101
+
97
102
  self.added_apps, self.updated_apps, self.removed_apps = self.calculate_app_deltas()
98
103
  current_span = trace.get_current_span()
99
104
  if current_span:
@@ -1,7 +1,7 @@
1
1
 
2
2
  [project]
3
3
  name = "gitops"
4
- version = "1.2.0"
4
+ version = "1.3.1"
5
5
  description = "Manage multiple apps across one or more k8s clusters."
6
6
  requires-python = ">=3.12"
7
7
  readme = "README.md"
@@ -375,3 +375,192 @@ SAMPLE_GITHUB_PAYLOAD_SKIP_MIGRATIONS = {
375
375
  "site_admin": False,
376
376
  },
377
377
  }
378
+
379
+ SAMPLE_GITHUB_PAYLOAD_SKIP_DEPLOY = {
380
+ "ref": "refs/heads/master",
381
+ "before": "bef04e58a0001234567890123456789012345678",
382
+ "after": "af7e458a00012345678901234567890123456789",
383
+ "created": False,
384
+ "deleted": False,
385
+ "forced": False,
386
+ "base_ref": None,
387
+ "compare": "https://github.com/user/mock-repo/compare/bef04e58a000...af7e458a0001",
388
+ "commits": [
389
+ {
390
+ "id": "c099171d00c099171d00c099171d00c099171d00",
391
+ "tree_id": "74ee1d000074ee1d000074ee1d000074ee1d0000",
392
+ "distinct": True,
393
+ "message": "bump test-app-1 --skip-deploy",
394
+ "timestamp": "2019-07-18T15:07:37+10:00",
395
+ "url": ("https://github.com/user/mock-repo/commit/c099171d00c099171d00c099171d00c099171d00"),
396
+ "author": {
397
+ "name": "Author Fullname",
398
+ "email": "author@example.com",
399
+ "username": "authorusername",
400
+ },
401
+ "committer": {
402
+ "name": "Author Fullname",
403
+ "email": "author@example.com",
404
+ "username": "authorusername",
405
+ },
406
+ "added": [],
407
+ "removed": [],
408
+ "modified": ["apps/test-app-1/deployment.yml"],
409
+ }
410
+ ],
411
+ "head_commit": {
412
+ "id": "c099171d00c099171d00c099171d00c099171d00",
413
+ "tree_id": "74ee1d000074ee1d000074ee1d000074ee1d0000",
414
+ "distinct": True,
415
+ "message": "bump test-app-1 --skip-deploy",
416
+ "timestamp": "2019-07-18T15:07:37+10:00",
417
+ "url": "https://github.com/user/mock-repo/commit/c099171d00c099171d00c099171d00c099171d00",
418
+ "author": {
419
+ "name": "Author Fullname",
420
+ "email": "author@example.com",
421
+ "username": "authorusername",
422
+ },
423
+ "committer": {
424
+ "name": "Author Fullname",
425
+ "email": "author@example.com",
426
+ "username": "authorusername",
427
+ },
428
+ "added": [],
429
+ "removed": [],
430
+ "modified": ["apps/test-app-1/deployment.yml"],
431
+ },
432
+ "repository": {
433
+ "id": 123123123,
434
+ "node_id": "NODEIDNODEIDNODEIDNODEIDNODEIDN=",
435
+ "name": "mock-repo",
436
+ "full_name": "user/mock-repo",
437
+ "private": True,
438
+ "owner": {
439
+ "name": "user",
440
+ "email": "admin@example.com",
441
+ "login": "user",
442
+ "id": 123123123,
443
+ "node_id": "NODEIDNODEIDNODEIDNODEIDNODEIDNO",
444
+ "avatar_url": "",
445
+ "gravatar_id": "",
446
+ "url": "https://api.github.com/users/user",
447
+ "html_url": "https://github.com/user",
448
+ "followers_url": "https://api.github.com/users/user/followers",
449
+ "following_url": "https://api.github.com/users/user/following{/other_user}",
450
+ "gists_url": "https://api.github.com/users/user/gists{/gist_id}",
451
+ "starred_url": "https://api.github.com/users/user/starred{/owner}{/repo}",
452
+ "subscriptions_url": "https://api.github.com/users/user/subscriptions",
453
+ "organizations_url": "https://api.github.com/users/user/orgs",
454
+ "repos_url": "https://api.github.com/users/user/repos",
455
+ "events_url": "https://api.github.com/users/user/events{/privacy}",
456
+ "received_events_url": "https://api.github.com/users/user/received_events",
457
+ "type": "Organization",
458
+ "site_admin": False,
459
+ },
460
+ "html_url": "https://github.com/user/mock-repo",
461
+ "description": "Kubernetes cluster configuration.",
462
+ "fork": False,
463
+ "url": "https://github.com/user/mock-repo",
464
+ "forks_url": "https://api.github.com/repos/user/mock-repo/forks",
465
+ "keys_url": "https://api.github.com/repos/user/mock-repo/keys{/key_id}",
466
+ "collaborators_url": ("https://api.github.com/repos/user/mock-repo/collaborators{/collaborator}"),
467
+ "teams_url": "https://api.github.com/repos/user/mock-repo/teams",
468
+ "hooks_url": "https://api.github.com/repos/user/mock-repo/hooks",
469
+ "issue_events_url": "https://api.github.com/repos/user/mock-repo/issues/events{/number}",
470
+ "events_url": "https://api.github.com/repos/user/mock-repo/events",
471
+ "assignees_url": "https://api.github.com/repos/user/mock-repo/assignees{/user}",
472
+ "branches_url": "https://api.github.com/repos/user/mock-repo/branches{/branch}",
473
+ "tags_url": "https://api.github.com/repos/user/mock-repo/tags",
474
+ "blobs_url": "https://api.github.com/repos/user/mock-repo/git/blobs{/sha}",
475
+ "git_tags_url": "https://api.github.com/repos/user/mock-repo/git/tags{/sha}",
476
+ "git_refs_url": "https://api.github.com/repos/user/mock-repo/git/refs{/sha}",
477
+ "trees_url": "https://api.github.com/repos/user/mock-repo/git/trees{/sha}",
478
+ "statuses_url": "https://api.github.com/repos/user/mock-repo/statuses/{sha}",
479
+ "languages_url": "https://api.github.com/repos/user/mock-repo/languages",
480
+ "stargazers_url": "https://api.github.com/repos/user/mock-repo/stargazers",
481
+ "contributors_url": "https://api.github.com/repos/user/mock-repo/contributors",
482
+ "subscribers_url": "https://api.github.com/repos/user/mock-repo/subscribers",
483
+ "subscription_url": "https://api.github.com/repos/user/mock-repo/subscription",
484
+ "commits_url": "https://api.github.com/repos/user/mock-repo/commits{/sha}",
485
+ "git_commits_url": "https://api.github.com/repos/user/mock-repo/git/commits{/sha}",
486
+ "comments_url": "https://api.github.com/repos/user/mock-repo/comments{/number}",
487
+ "issue_comment_url": "https://api.github.com/repos/user/mock-repo/issues/comments{/number}",
488
+ "contents_url": "https://api.github.com/repos/user/mock-repo/contents/{+path}",
489
+ "compare_url": "https://api.github.com/repos/user/mock-repo/compare/{base}...{head}",
490
+ "merges_url": "https://api.github.com/repos/user/mock-repo/merges",
491
+ "archive_url": "https://api.github.com/repos/user/mock-repo/{archive_format}{/ref}",
492
+ "downloads_url": "https://api.github.com/repos/user/mock-repo/downloads",
493
+ "issues_url": "https://api.github.com/repos/user/mock-repo/issues{/number}",
494
+ "pulls_url": "https://api.github.com/repos/user/mock-repo/pulls{/number}",
495
+ "milestones_url": "https://api.github.com/repos/user/mock-repo/milestones{/number}",
496
+ "notifications_url": ("https://api.github.com/repos/user/mock-repo/notifications{?since,all,participating}"),
497
+ "labels_url": "https://api.github.com/repos/user/mock-repo/labels{/name}",
498
+ "releases_url": "https://api.github.com/repos/user/mock-repo/releases{/id}",
499
+ "deployments_url": "https://api.github.com/repos/user/mock-repo/deployments",
500
+ "created_at": 123123,
501
+ "updated_at": "2019-07-18T05:05:03Z",
502
+ "pushed_at": 123123,
503
+ "git_url": "git://github.com/user/mock-repo.git",
504
+ "ssh_url": "git@github.com:user/mock-repo.git",
505
+ "clone_url": "https://github.com/user/mock-repo.git",
506
+ "svn_url": "https://github.com/user/mock-repo",
507
+ "homepage": "",
508
+ "size": 2917,
509
+ "stargazers_count": 0,
510
+ "watchers_count": 0,
511
+ "language": "Python",
512
+ "has_issues": True,
513
+ "has_projects": True,
514
+ "has_downloads": True,
515
+ "has_wiki": True,
516
+ "has_pages": False,
517
+ "forks_count": 0,
518
+ "mirror_url": None,
519
+ "archived": False,
520
+ "disabled": False,
521
+ "open_issues_count": 5,
522
+ "license": None,
523
+ "forks": 0,
524
+ "open_issues": 5,
525
+ "watchers": 0,
526
+ "default_branch": "master",
527
+ "stargazers": 0,
528
+ "master_branch": "master",
529
+ "organization": "user",
530
+ },
531
+ "pusher": {"name": "authorusername", "email": "author@example.com"},
532
+ "organization": {
533
+ "login": "user",
534
+ "id": 123123,
535
+ "node_id": "NODEID00NODEID00NODEID00NODEID00",
536
+ "url": "https://api.github.com/orgs/user",
537
+ "repos_url": "https://api.github.com/orgs/user/repos",
538
+ "events_url": "https://api.github.com/orgs/user/events",
539
+ "hooks_url": "https://api.github.com/orgs/user/hooks",
540
+ "issues_url": "https://api.github.com/orgs/user/issues",
541
+ "members_url": "https://api.github.com/orgs/user/members{/member}",
542
+ "public_members_url": "https://api.github.com/orgs/user/public_members{/member}",
543
+ "avatar_url": "",
544
+ "description": "",
545
+ },
546
+ "sender": {
547
+ "login": "authorusername",
548
+ "id": 123123,
549
+ "node_id": "NODEID00NODEID00NOD=",
550
+ "avatar_url": "https://avatars0.githubusercontent.com/u/5036488?v=4",
551
+ "gravatar_id": "",
552
+ "url": "https://api.github.com/users/authorusername",
553
+ "html_url": "https://github.com/authorusername",
554
+ "followers_url": "https://api.github.com/users/authorusername/followers",
555
+ "following_url": "https://api.github.com/users/authorusername/following{/other_user}",
556
+ "gists_url": "https://api.github.com/users/authorusername/gists{/gist_id}",
557
+ "starred_url": "https://api.github.com/users/authorusername/starred{/owner}{/repo}",
558
+ "subscriptions_url": "https://api.github.com/users/authorusername/subscriptions",
559
+ "organizations_url": "https://api.github.com/users/authorusername/orgs",
560
+ "repos_url": "https://api.github.com/users/authorusername/repos",
561
+ "events_url": "https://api.github.com/users/authorusername/events{/privacy}",
562
+ "received_events_url": "https://api.github.com/users/authorusername/received_events",
563
+ "type": "User",
564
+ "site_admin": False,
565
+ },
566
+ }
@@ -7,7 +7,7 @@ from gitops.common.app import App
7
7
  from gitops_server.types import AppDefinitions
8
8
  from gitops_server.workers.deployer import Deployer
9
9
 
10
- from .sample_data import SAMPLE_GITHUB_PAYLOAD, SAMPLE_GITHUB_PAYLOAD_SKIP_MIGRATIONS
10
+ from .sample_data import SAMPLE_GITHUB_PAYLOAD, SAMPLE_GITHUB_PAYLOAD_SKIP_DEPLOY, SAMPLE_GITHUB_PAYLOAD_SKIP_MIGRATIONS
11
11
  from .utils import create_test_yaml, mock_load_app_definitions
12
12
 
13
13
  # Patch gitops_server.git.run & check correct commands + order
@@ -102,6 +102,22 @@ class TestDeploy:
102
102
  )
103
103
  assert post_mock.call_count == 2
104
104
 
105
+ @patch("gitops_server.workers.deployer.deploy.run")
106
+ @patch("gitops_server.utils.slack.post")
107
+ @patch("gitops_server.workers.deployer.deploy.load_app_definitions", mock_load_app_definitions)
108
+ @patch("gitops_server.workers.deployer.deploy.temp_repo")
109
+ async def test_skip_deploy_in_commit_message_should_not_run_deployment(self, temp_repo_mock, post_mock, run_mock):
110
+ """Fake a deploy to two servers, bumping fg from 2 to 4."""
111
+ run_mock.return_value = {"exit_code": 0, "output": ""}
112
+ temp_repo_mock.return_value.__aenter__.return_value = "mock-repo"
113
+ deployer = await Deployer.from_push_event(SAMPLE_GITHUB_PAYLOAD_SKIP_DEPLOY)
114
+
115
+ assert deployer.skip_deploy is True
116
+ await deployer.deploy()
117
+
118
+ assert run_mock.call_count == 0
119
+ assert post_mock.call_count == 0
120
+
105
121
 
106
122
  class TestLoadAppDefinitions:
107
123
  def test_load_app_definitions_ignores_suspended_apps(self):
@@ -1 +0,0 @@
1
- __version__ = "1.2.0"
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes