devs-webhook 1.2.0__tar.gz → 1.2.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 (51) hide show
  1. {devs_webhook-1.2.0 → devs_webhook-1.2.1}/PKG-INFO +1 -1
  2. {devs_webhook-1.2.0 → devs_webhook-1.2.1}/devs_webhook/config.py +9 -2
  3. {devs_webhook-1.2.0 → devs_webhook-1.2.1}/devs_webhook/main_cli.py +14 -9
  4. {devs_webhook-1.2.0 → devs_webhook-1.2.1}/devs_webhook.egg-info/PKG-INFO +1 -1
  5. {devs_webhook-1.2.0 → devs_webhook-1.2.1}/pyproject.toml +1 -1
  6. {devs_webhook-1.2.0 → devs_webhook-1.2.1}/LICENSE +0 -0
  7. {devs_webhook-1.2.0 → devs_webhook-1.2.1}/README.md +0 -0
  8. {devs_webhook-1.2.0 → devs_webhook-1.2.1}/devs_webhook/__init__.py +0 -0
  9. {devs_webhook-1.2.0 → devs_webhook-1.2.1}/devs_webhook/app.py +0 -0
  10. {devs_webhook-1.2.0 → devs_webhook-1.2.1}/devs_webhook/cli/__init__.py +0 -0
  11. {devs_webhook-1.2.0 → devs_webhook-1.2.1}/devs_webhook/cli/worker.py +0 -0
  12. {devs_webhook-1.2.0 → devs_webhook-1.2.1}/devs_webhook/core/__init__.py +0 -0
  13. {devs_webhook-1.2.0 → devs_webhook-1.2.1}/devs_webhook/core/base_dispatcher.py +0 -0
  14. {devs_webhook-1.2.0 → devs_webhook-1.2.1}/devs_webhook/core/claude_dispatcher.py +0 -0
  15. {devs_webhook-1.2.0 → devs_webhook-1.2.1}/devs_webhook/core/container_pool.py +0 -0
  16. {devs_webhook-1.2.0 → devs_webhook-1.2.1}/devs_webhook/core/deduplication.py +0 -0
  17. {devs_webhook-1.2.0 → devs_webhook-1.2.1}/devs_webhook/core/repository_manager.py +0 -0
  18. {devs_webhook-1.2.0 → devs_webhook-1.2.1}/devs_webhook/core/task_processor.py +0 -0
  19. {devs_webhook-1.2.0 → devs_webhook-1.2.1}/devs_webhook/core/test_dispatcher.py +0 -0
  20. {devs_webhook-1.2.0 → devs_webhook-1.2.1}/devs_webhook/core/webhook_config.py +0 -0
  21. {devs_webhook-1.2.0 → devs_webhook-1.2.1}/devs_webhook/core/webhook_handler.py +0 -0
  22. {devs_webhook-1.2.0 → devs_webhook-1.2.1}/devs_webhook/github/__init__.py +0 -0
  23. {devs_webhook-1.2.0 → devs_webhook-1.2.1}/devs_webhook/github/app_auth.py +0 -0
  24. {devs_webhook-1.2.0 → devs_webhook-1.2.1}/devs_webhook/github/client.py +0 -0
  25. {devs_webhook-1.2.0 → devs_webhook-1.2.1}/devs_webhook/github/models.py +0 -0
  26. {devs_webhook-1.2.0 → devs_webhook-1.2.1}/devs_webhook/github/parser.py +0 -0
  27. {devs_webhook-1.2.0 → devs_webhook-1.2.1}/devs_webhook/sources/__init__.py +0 -0
  28. {devs_webhook-1.2.0 → devs_webhook-1.2.1}/devs_webhook/sources/base.py +0 -0
  29. {devs_webhook-1.2.0 → devs_webhook-1.2.1}/devs_webhook/sources/sqs_source.py +0 -0
  30. {devs_webhook-1.2.0 → devs_webhook-1.2.1}/devs_webhook/sources/webhook_source.py +0 -0
  31. {devs_webhook-1.2.0 → devs_webhook-1.2.1}/devs_webhook/utils/__init__.py +0 -0
  32. {devs_webhook-1.2.0 → devs_webhook-1.2.1}/devs_webhook/utils/async_utils.py +0 -0
  33. {devs_webhook-1.2.0 → devs_webhook-1.2.1}/devs_webhook/utils/container_logs.py +0 -0
  34. {devs_webhook-1.2.0 → devs_webhook-1.2.1}/devs_webhook/utils/github.py +0 -0
  35. {devs_webhook-1.2.0 → devs_webhook-1.2.1}/devs_webhook/utils/logging.py +0 -0
  36. {devs_webhook-1.2.0 → devs_webhook-1.2.1}/devs_webhook/utils/s3_artifacts.py +0 -0
  37. {devs_webhook-1.2.0 → devs_webhook-1.2.1}/devs_webhook/utils/serialization.py +0 -0
  38. {devs_webhook-1.2.0 → devs_webhook-1.2.1}/devs_webhook.egg-info/SOURCES.txt +0 -0
  39. {devs_webhook-1.2.0 → devs_webhook-1.2.1}/devs_webhook.egg-info/dependency_links.txt +0 -0
  40. {devs_webhook-1.2.0 → devs_webhook-1.2.1}/devs_webhook.egg-info/entry_points.txt +0 -0
  41. {devs_webhook-1.2.0 → devs_webhook-1.2.1}/devs_webhook.egg-info/requires.txt +0 -0
  42. {devs_webhook-1.2.0 → devs_webhook-1.2.1}/devs_webhook.egg-info/top_level.txt +0 -0
  43. {devs_webhook-1.2.0 → devs_webhook-1.2.1}/setup.cfg +0 -0
  44. {devs_webhook-1.2.0 → devs_webhook-1.2.1}/tests/test_allowlist.py +0 -0
  45. {devs_webhook-1.2.0 → devs_webhook-1.2.1}/tests/test_authentication.py +0 -0
  46. {devs_webhook-1.2.0 → devs_webhook-1.2.1}/tests/test_authorized_users.py +0 -0
  47. {devs_webhook-1.2.0 → devs_webhook-1.2.1}/tests/test_ci_container_pool.py +0 -0
  48. {devs_webhook-1.2.0 → devs_webhook-1.2.1}/tests/test_container_logs.py +0 -0
  49. {devs_webhook-1.2.0 → devs_webhook-1.2.1}/tests/test_single_queue.py +0 -0
  50. {devs_webhook-1.2.0 → devs_webhook-1.2.1}/tests/test_sqs_burst.py +0 -0
  51. {devs_webhook-1.2.0 → devs_webhook-1.2.1}/tests/test_webhook_parser.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: devs-webhook
3
- Version: 1.2.0
3
+ Version: 1.2.1
4
4
  Summary: GitHub webhook handler for automated devcontainer operations with Claude Code
5
5
  Author: Dan Lester
6
6
  License-Expression: MIT
@@ -3,7 +3,7 @@
3
3
  import os
4
4
  from pathlib import Path
5
5
  from functools import lru_cache
6
- from typing import List, Optional
6
+ from typing import Dict, List, Optional
7
7
  try:
8
8
  from pydantic_settings import BaseSettings, SettingsConfigDict
9
9
  except ImportError:
@@ -181,7 +181,14 @@ class WebhookConfig(BaseSettings, BaseConfig):
181
181
  if self.log_format == "json":
182
182
  self.log_format = "console"
183
183
  return self
184
-
184
+
185
+ @property
186
+ def container_labels(self) -> Dict[str, str]:
187
+ """Standard labels applied to containers created by webhook."""
188
+ labels = super().container_labels
189
+ labels["devs.source"] = "webhook"
190
+ return labels
191
+
185
192
  # Configuration for Pydantic Settings
186
193
  # Note: .env files are optional - environment variables are the primary source
187
194
  if SettingsConfigDict:
@@ -448,23 +448,25 @@ def test(prompt: str, repo: str, host: str, port: int, username: str, password:
448
448
 
449
449
 
450
450
  @cli.command()
451
- @click.option('--all', 'cleanup_all', is_flag=True, help='Clean up all managed containers (not just idle ones)')
451
+ @click.option('--all', 'cleanup_all', is_flag=True, help='Clean up all webhook containers (not just idle ones)')
452
452
  @click.option('--max-age-hours', default=None, type=int, help='Override max age threshold (default: from config or 10)')
453
453
  @click.option('--idle-minutes', default=None, type=int, help='Override idle timeout (default: from config or 60)')
454
454
  @click.option('--dry-run', is_flag=True, help='Show what would be cleaned up without actually doing it')
455
455
  def cleanup(cleanup_all: bool, max_age_hours: int, idle_minutes: int, dry_run: bool):
456
- """Clean up idle and old containers.
456
+ """Clean up idle and old webhook containers.
457
457
 
458
- This command finds containers managed by devs-webhook and cleans up those that
458
+ This command finds containers created by devs-webhook and cleans up those that
459
459
  are idle (exited, or running but not processing) and either:
460
460
  - Idle for longer than the idle timeout
461
461
  - Older than the max age threshold
462
462
 
463
+ Only cleans up webhook-created containers (not CLI-created ones).
464
+
463
465
  Use this after burst mode processing completes, or via cron for periodic cleanup.
464
466
 
465
467
  Examples:
466
468
  devs-webhook cleanup # Clean up idle containers exceeding thresholds
467
- devs-webhook cleanup --all # Clean up ALL managed containers
469
+ devs-webhook cleanup --all # Clean up ALL webhook containers
468
470
  devs-webhook cleanup --dry-run # Show what would be cleaned up
469
471
  devs-webhook cleanup --max-age-hours 2 # Override max age to 2 hours
470
472
  """
@@ -487,7 +489,7 @@ def cleanup(cleanup_all: bool, max_age_hours: int, idle_minutes: int, dry_run: b
487
489
  click.echo(f" Max age: {max_age.total_seconds() / 3600:.1f} hours")
488
490
  click.echo(f" Idle timeout: {idle_timeout.total_seconds() / 60:.0f} minutes")
489
491
  if cleanup_all:
490
- click.echo(" Mode: Clean ALL managed containers")
492
+ click.echo(" Mode: Clean ALL webhook containers")
491
493
  if dry_run:
492
494
  click.echo(" Mode: DRY RUN (no changes will be made)")
493
495
  click.echo()
@@ -498,18 +500,21 @@ def cleanup(cleanup_all: bool, max_age_hours: int, idle_minutes: int, dry_run: b
498
500
  click.echo(f"❌ Failed to connect to Docker: {e}")
499
501
  return
500
502
 
501
- # Find all devs-managed containers
503
+ # Find webhook-created containers only
502
504
  try:
503
- containers = docker.find_containers_by_labels({"devs.managed": "true"})
505
+ containers = docker.find_containers_by_labels({
506
+ "devs.managed": "true",
507
+ "devs.source": "webhook"
508
+ })
504
509
  except Exception as e:
505
510
  click.echo(f"❌ Failed to list containers: {e}")
506
511
  return
507
512
 
508
513
  if not containers:
509
- click.echo("✅ No managed containers found")
514
+ click.echo("✅ No webhook containers found")
510
515
  return
511
516
 
512
- click.echo(f"Found {len(containers)} managed container(s)")
517
+ click.echo(f"Found {len(containers)} webhook container(s)")
513
518
 
514
519
  now = datetime.now(tz=timezone.utc)
515
520
  cleaned = 0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: devs-webhook
3
- Version: 1.2.0
3
+ Version: 1.2.1
4
4
  Summary: GitHub webhook handler for automated devcontainer operations with Claude Code
5
5
  Author: Dan Lester
6
6
  License-Expression: MIT
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
4
4
 
5
5
  [project]
6
6
  name = "devs-webhook"
7
- version = "1.2.0"
7
+ version = "1.2.1"
8
8
  description = "GitHub webhook handler for automated devcontainer operations with Claude Code"
9
9
  readme = "README.md"
10
10
  requires-python = ">=3.8"
File without changes
File without changes
File without changes