| |
@@ -50,6 +50,18 @@
|
| |
def update_status(self, status):
|
| |
self.status = status
|
| |
|
| |
+ def update_migrated_status(self):
|
| |
+ '''check for the presense of a MIGRATED file'''
|
| |
+ # construct url to "raw" file in pagure's interface
|
| |
+ migrated_url = config.PAGURE_URL + '{}/raw/{}/f/MIGRATED'.format(self.name, config.DEFAULT_BRANCH)
|
| |
+
|
| |
+ # try to stat the file
|
| |
+ migrated_request = requests.get(migrated_url)
|
| |
+
|
| |
+ if migrated_request.status_code == 200:
|
| |
+ self.update_status('MIGRATED')
|
| |
+ else:
|
| |
+ self.update_status('WORKING')
|
| |
|
| |
def get_session():
|
| |
'''Return a session object to interact with the database.'''
|
| |
@@ -118,14 +130,8 @@
|
| |
if proj:
|
| |
proj.pagure_link = '{}{}'.format(config.PAGURE_URL, proj.name)
|
| |
proj.contact = str(poc)
|
| |
- # Check to see if the project is labeled as migrated and has issues filed
|
| |
- if proj.status == u"MIGRATED":
|
| |
- proj.get_project_issues()
|
| |
- # Set the status to MIGRATED because it has a project created on the forge
|
| |
- elif proj.status == u"UNKNOWN":
|
| |
- proj.update_status(u"MIGRATED")
|
| |
- else:
|
| |
- pass
|
| |
+
|
| |
+ proj.update_migrated_status()
|
| |
|
| |
session.add(proj)
|
| |
session.commit()
|
| |
changes the logic of server.py to look for a
MIGRATED
file in order to determine whether or not a repo has been migrated upstream