Record passing P08 evidence validator and concrete cache cleanup proposal
This commit is contained in:
@@ -115,7 +115,8 @@ def packet_with_actual_evidence(self, task_id, role, sha=None):
|
||||
packet = original_packet(self, task_id, role, sha)
|
||||
if role == 'reviewer' and self.config['project'] == 'the-tree-p08-03-code' and task_id == 'P08-03':
|
||||
import hashlib
|
||||
frozen = Path(os.environ['OWNER_P08_PREPARED_REVIEW'])
|
||||
frozen = getattr(self, '_owner_frozen_review_checkout', None)
|
||||
require(frozen is not None and git(frozen, 'rev-parse', 'HEAD') == sha, 'actual frozen review candidate')
|
||||
prefix, data = packet.split('\nDATA:\n', 1)
|
||||
body = json.loads(data)
|
||||
context = frozen / '.owner-review-context'
|
||||
@@ -278,5 +279,13 @@ if os.environ.get('OWNER_P08_RECOVER_PARTIAL_SUBMIT') == '647196f':
|
||||
print(json.dumps({'submitted': r.task('P08-03')['submitted'], 'state': r.task('P08-03')['state']}))
|
||||
sys.exit(0)
|
||||
|
||||
_recorded_detached = Runner.detached
|
||||
def recorded_review_checkout(self, name, revision):
|
||||
checkout = _recorded_detached(self, name, revision)
|
||||
if self.config['project'] == 'the-tree-p08-03-code' and name.startswith('P08-03-review-'):
|
||||
self._owner_frozen_review_checkout = Path(checkout)
|
||||
return checkout
|
||||
Runner.detached = recorded_review_checkout
|
||||
|
||||
from runner.cli import main
|
||||
main()
|
||||
|
||||
Reference in New Issue
Block a user