File tree Expand file tree Collapse file tree 2 files changed +15
-1
lines changed
Expand file tree Collapse file tree 2 files changed +15
-1
lines changed Original file line number Diff line number Diff line change @@ -127,6 +127,17 @@ def run(self, args):
127127 # sanitize path for os.path.join()
128128 path = path .strip ("/" )
129129
130+ metadata_dir = os .path .join (path , "metadata" )
131+ try :
132+ with open (os .path .join (metadata_dir , "pr.json" )) as f :
133+ pr_data = json .load (f )
134+ if pr_data ["updated_at" ] == pr_obj .updated_at :
135+ # no update, skip the dump
136+ continue
137+ except FileNotFoundError :
138+ # no local metadata cached, we can't skip the dump
139+ pass
140+
130141 review_obj_list = pr_obj .get_reviews (self .gitea_conn )
131142
132143 # see https://github.com/go-gitea/gitea/blob/main/modules/structs/pull_review.go - look for "type ReviewStateType string"
@@ -238,7 +249,6 @@ def run(self, args):
238249 ET .Comment ("The state='comment' attribute value is a custom extension to the OBS XML schema." ),
239250 )
240251
241- metadata_dir = os .path .join (path , "metadata" )
242252 try :
243253 # remove old metadata first to ensure that we never keep any of the old files on an update
244254 shutil .rmtree (metadata_dir )
Original file line number Diff line number Diff line change @@ -154,6 +154,10 @@ def body(self) -> str:
154154 def state (self ) -> str :
155155 return self ._data ["state" ]
156156
157+ @property
158+ def updated_at (self ) -> str :
159+ return self ._data ["updated_at" ]
160+
157161 @property
158162 def user (self ) -> str :
159163 return self ._data ["user" ]["login" ]
You can’t perform that action at this time.
0 commit comments