primitive 0.2.32__py3-none-any.whl → 0.2.34__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.
primitive/__about__.py CHANGED
@@ -1,4 +1,4 @@
1
1
  # SPDX-FileCopyrightText: 2024-present Dylan Stein <dylan@primitive.tech>
2
2
  #
3
3
  # SPDX-License-Identifier: MIT
4
- __version__ = "0.2.32"
4
+ __version__ = "0.2.34"
primitive/agent/runner.py CHANGED
@@ -119,20 +119,27 @@ class Runner:
119
119
  self.job_settings["rootDirectory"]
120
120
  )
121
121
 
122
- # Attempt to parse the job yaml file
123
- job_filename = self.job_settings["repositoryFilename"]
124
- logger.info(f"Scanning directory for job file {job_filename}")
122
+ db_config = self.job_settings.get("config", None)
123
+ if db_config:
124
+ logger.info(f"Using job config from database for {self.job['slug']}")
125
+ self.config = db_config
126
+ else:
127
+ # Attempt to parse the job yaml file
128
+ job_filename = self.job_settings["repositoryFilename"]
129
+ logger.info(f"Scanning directory for job file {job_filename}")
125
130
 
126
- job_config_file = Path(self.source_dir / ".primitive" / job_filename)
131
+ job_config_file = Path(self.source_dir / ".primitive" / job_filename)
127
132
 
128
- if job_config_file.exists():
129
- logger.info(f"Found job description for {self.job['slug']}")
130
- self.config = yaml.load(open(job_config_file, "r"), Loader=Loader)
131
- else:
132
- logger.error(
133
- f"No job description with matching filename '{job_filename}' found"
134
- )
135
- raise FileNotFoundError
133
+ if job_config_file.exists():
134
+ logger.info(
135
+ f"Found job description for {self.job['slug']} at {job_config_file}"
136
+ )
137
+ self.config = yaml.load(open(job_config_file, "r"), Loader=Loader)
138
+ else:
139
+ logger.error(
140
+ f"No job description with matching filename '{job_filename}' found"
141
+ )
142
+ raise FileNotFoundError
136
143
 
137
144
  # Setup initial process environment
138
145
  self.initial_env = os.environ
@@ -346,13 +353,15 @@ class Runner:
346
353
  elif parse_logs and "warning" in line.lower():
347
354
  level = LogLevel.WARNING
348
355
 
349
- failure_detected = (
350
- level == LogLevel.ERROR
351
- and self.job_settings["failureLevel"] >= FailureLevel.ERROR
352
- ) or (
353
- level == LogLevel.WARNING
354
- and self.job_settings["failureLevel"] >= FailureLevel.WARNING
355
- )
356
+ # If we already detected a failure, skip checking
357
+ if not failure_detected:
358
+ failure_detected = (
359
+ level == LogLevel.ERROR
360
+ and self.job_settings["failureLevel"] >= FailureLevel.ERROR
361
+ ) or (
362
+ level == LogLevel.WARNING
363
+ and self.job_settings["failureLevel"] >= FailureLevel.WARNING
364
+ )
356
365
 
357
366
  # Tag on the first matching regex in the list
358
367
  for tag_key, regex in tags.items():
@@ -35,6 +35,7 @@ fragment JobRunFragment on JobRun {
35
35
  parseStderr
36
36
  failureLevel
37
37
  repositoryFilename
38
+ config
38
39
  }
39
40
  gitCommit {
40
41
  sha
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: primitive
3
- Version: 0.2.32
3
+ Version: 0.2.34
4
4
  Project-URL: Documentation, https://github.com//primitivecorp/primitive-cli#readme
5
5
  Project-URL: Issues, https://github.com//primitivecorp/primitive-cli/issues
6
6
  Project-URL: Source, https://github.com//primitivecorp/primitive-cli
@@ -1,11 +1,11 @@
1
- primitive/__about__.py,sha256=oC0l5fABhgagaC-_r-5QZ1VPn7hy8tdJID7wI0iTSow,130
1
+ primitive/__about__.py,sha256=s58wIznYy_MiaxrfZEt9pFQ41lrUgI4Bc_OF1gkNEwg,130
2
2
  primitive/__init__.py,sha256=bwKdgggKNVssJFVPfKSxqFMz4IxSr54WWbmiZqTMPNI,106
3
3
  primitive/cli.py,sha256=g7EtHI9MATAB0qQu5w-WzbXtxz_8zu8z5E7sETmMkKU,2509
4
4
  primitive/client.py,sha256=h8WZVnQylVe0vbpuyC8YZHl2JyITSPC-1HbUcmrE5pc,3623
5
5
  primitive/agent/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
6
6
  primitive/agent/actions.py,sha256=JLnHCtu0AgeHRZccCc2I39mziLixmj9EKtKeYmvBE7A,3700
7
7
  primitive/agent/commands.py,sha256=cK7d3OcN5Z65gQWVZFQ-Y9ddw9Pes4f9OVBpeMsj5sE,255
8
- primitive/agent/runner.py,sha256=e4HBhK16zuhTpKAdKsgoij6G4YjMTn9JQo2YTLRI8i8,15008
8
+ primitive/agent/runner.py,sha256=Vuz0bJjfq3IytLI6HxC9Gfd1TdARjvNsG273GEWxjKI,15462
9
9
  primitive/agent/uploader.py,sha256=ZzrzsajNBogwEC7mT6Ejy0h2Jd9axMYGzt9pbCvVMlk,3171
10
10
  primitive/auth/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
11
11
  primitive/auth/actions.py,sha256=9NIEXJ1BNJutJs6AMMSjMN_ziONUAUhY_xHwojYJCLA,942
@@ -54,7 +54,7 @@ primitive/jobs/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
54
54
  primitive/jobs/actions.py,sha256=Fx2cPc1x09nRasOVtjhPjNRJ-jNoi3RJhXqC3verD9s,5444
55
55
  primitive/jobs/commands.py,sha256=MxPCkBEYW_eLNqgCRYeyj7ZcLOFAWfpVZlqDR2Y_S0o,830
56
56
  primitive/jobs/graphql/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
57
- primitive/jobs/graphql/fragments.py,sha256=pS6jXZ9yxvPKjKx50zpwzARJHYlg7NQLYCm1voiuCzI,642
57
+ primitive/jobs/graphql/fragments.py,sha256=flBi4REkfPX3sao22McmjclK-lFsqiXQa21YKmTbxu8,653
58
58
  primitive/jobs/graphql/mutations.py,sha256=8ASvCmwQh7cMeeiykOdYaYVryG8FRIuVF6v_J8JJZuw,219
59
59
  primitive/jobs/graphql/queries.py,sha256=ZxNmm-WovytbggNuKRnwa0kc26T34_0yhqkoqx-2uj0,1736
60
60
  primitive/monitor/actions.py,sha256=aYe5OfgCxhapXbcvz7vSlIMAcLOFRcAUWmdBZ8H7UWs,10889
@@ -96,8 +96,8 @@ primitive/utils/memory_size.py,sha256=4xfha21kW82nFvOTtDFx9Jk2ZQoEhkfXii-PGNTpIU
96
96
  primitive/utils/printer.py,sha256=f1XUpqi5dkTL3GWvYRUGlSwtj2IxU1q745T4Fxo7Tn4,370
97
97
  primitive/utils/shell.py,sha256=Z4zxmOaSyGCrS0D6I436iQci-ewHLt4UxVg1CD9Serc,2171
98
98
  primitive/utils/text.py,sha256=XiESMnlhjQ534xE2hMNf08WehE1SKaYFRNih0MmnK0k,829
99
- primitive-0.2.32.dist-info/METADATA,sha256=z-2bverx3L8RAyVNxxYWBv_-3UjdTgfZbk_ety8Swlo,3569
100
- primitive-0.2.32.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
101
- primitive-0.2.32.dist-info/entry_points.txt,sha256=p1K8DMCWka5FqLlqP1sPek5Uovy9jq8u51gUsP-z334,48
102
- primitive-0.2.32.dist-info/licenses/LICENSE.txt,sha256=B8kmQMJ2sxYygjCLBk770uacaMci4mPSoJJ8WoDBY_c,1098
103
- primitive-0.2.32.dist-info/RECORD,,
99
+ primitive-0.2.34.dist-info/METADATA,sha256=tXBOqx2I7GoxBe13HXcWi0qSby1oIwlX4_hdwNicsYQ,3569
100
+ primitive-0.2.34.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
101
+ primitive-0.2.34.dist-info/entry_points.txt,sha256=p1K8DMCWka5FqLlqP1sPek5Uovy9jq8u51gUsP-z334,48
102
+ primitive-0.2.34.dist-info/licenses/LICENSE.txt,sha256=B8kmQMJ2sxYygjCLBk770uacaMci4mPSoJJ8WoDBY_c,1098
103
+ primitive-0.2.34.dist-info/RECORD,,