Skip to content

Commit

Permalink
Merge pull request #3143 from kraih/legaldb_comments
Browse files Browse the repository at this point in the history
legal-auto: Link to legal review via comment
  • Loading branch information
Vogtinator committed Aug 20, 2024
2 parents 6d79e25 + 5da463d commit 648451d
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions legal-auto.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
import osc.conf
import osc.core
from osclib.cache_manager import CacheManager
from osclib.comments import CommentAPI
import ReviewBot

http_GET = osc.core.http_GET
Expand Down Expand Up @@ -79,6 +80,12 @@ def create_db_entry(self, src_project, src_package, src_rev):
url = osc.core.makeurl(self.legaldb, ['requests'], {'external_link': self.request_nick(),
'package': package['id']})
REQ.post(url, headers=self.legaldb_headers)

comment_api = CommentAPI(self.apiurl)
review_url = osc.core.makeurl(self.legaldb, ['reviews', 'details', str(package['id'])])
review_comment = f"Legal review details available at {review_url} (access may be restricted)"
comment_api.add_comment(request_id=self.request.reqid, comment=review_comment)

return [package['id']]

def valid_for_opensuse(self, target_project, report):
Expand Down

0 comments on commit 648451d

Please sign in to comment.