|
38 | 38 | ERROR_README_DUPLICATE_ALT_TEXT = "README has duplicate alt text" |
39 | 39 | ERROR_README_MISSING_DISCORD_BADGE = "README missing Discord badge" |
40 | 40 | ERROR_README_MISSING_RTD_BADGE = "README missing ReadTheDocs badge" |
41 | | -ERROR_README_MISSING_TRAVIS_BADGE = "README missing Travis badge" |
| 41 | +ERROR_README_MISSING_CI_BADGE = "README missing CI badge" |
| 42 | +ERROR_README_MISSING_CI_ACTIONS_BADGE = "README CI badge needs to be changed" \ |
| 43 | +" to GitHub Actions" |
42 | 44 | ERROR_PYFILE_DOWNLOAD_FAILED = "Failed to download .py code file" |
43 | 45 | ERROR_PYFILE_MISSING_STRUCT = ".py file contains reference to import ustruct" \ |
44 | 46 | " without reference to import struct. See issue " \ |
|
104 | 106 | ERROR_PYLINT_VERSION_NOT_LATEST = "PyLint version not latest" |
105 | 107 | ERROR_NEW_REPO_IN_WORK = "New repo(s) currently in work, and unreleased" |
106 | 108 |
|
| 109 | +# Temp category for GitHub Actions migration. |
| 110 | +ERROR_NEEDS_ACTION_MIGRATION = "Repo(s) need to be migrated from TravisCI to GitHub Actions" |
| 111 | + |
107 | 112 | # Since this has been refactored into a separate module, the connection to 'output_handler()' |
108 | 113 | # and associated 'file_data' list is broken. To keep from possibly having conflicted |
109 | 114 | # file operations, and writing to the `output_filename` concurrently, establish an |
@@ -315,7 +320,11 @@ def _validate_readme(self, repo, download_url): |
315 | 320 | errors.append(ERROR_README_MISSING_RTD_BADGE) |
316 | 321 |
|
317 | 322 | if "Build Status" not in badges: |
318 | | - errors.append(ERROR_README_MISSING_TRAVIS_BADGE) |
| 323 | + errors.append(ERROR_README_MISSING_CI_BADGE) |
| 324 | + else: |
| 325 | + status_img = badges["Build Status"]["image"] |
| 326 | + if "travis-ci.com" in status_img: |
| 327 | + errors.append(ERROR_README_MISSING_CI_ACTIONS_BADGE) |
319 | 328 |
|
320 | 329 | return errors |
321 | 330 |
|
@@ -364,8 +373,10 @@ def _validate_py_for_u_modules(self, repo, download_url): |
364 | 373 | return errors |
365 | 374 |
|
366 | 375 | def _validate_travis_yml(self, repo, travis_yml_file_info): |
367 | | - """Check size and then check pypi compatibility. |
| 376 | + """DISABLED/NO LONGER CALLED: Check size and then check pypi compatibility. |
368 | 377 | """ |
| 378 | + return [] |
| 379 | + |
369 | 380 | download_url = travis_yml_file_info["download_url"] |
370 | 381 | contents = requests.get(download_url, timeout=30) |
371 | 382 | if not contents.ok: |
@@ -494,10 +505,7 @@ def validate_contents(self, repo): |
494 | 505 | readme_info["download_url"])) |
495 | 506 |
|
496 | 507 | if ".travis.yml" in files: |
497 | | - file_info = content_list[files.index(".travis.yml")] |
498 | | - errors.extend(self._validate_travis_yml(repo, file_info)) |
499 | | - else: |
500 | | - errors.append(ERROR_MISSING_TRAVIS_CONFIG) |
| 508 | + errors.append(ERROR_NEEDS_ACTION_MIGRATION) |
501 | 509 |
|
502 | 510 | if "readthedocs.yml" in files or ".readthedocs.yml" in files: |
503 | 511 | fn = "readthedocs.yml" |
@@ -592,13 +600,15 @@ def validate_contents(self, repo): |
592 | 600 |
|
593 | 601 | return errors |
594 | 602 |
|
595 | | - def validate_travis(self, repo): |
596 | | - """Validate and configure a repository has the expected state in Travis |
| 603 | + def _validate_travis(self, repo): |
| 604 | + """ DISABLED: Validate and configure a repository has the expected state in Travis |
597 | 605 | CI. This will both check Travis state and attempt to enable Travis CI |
598 | 606 | and setup the expected state in Travis if not enabled. Expects a |
599 | 607 | dictionary with a GitHub API repository state (like from the list_repos |
600 | 608 | function). Returns a list of string error messages for the repository. |
601 | 609 | """ |
| 610 | + return [] |
| 611 | + |
602 | 612 | if not (repo["owner"]["login"] == "adafruit" and |
603 | 613 | repo["name"].startswith("Adafruit_CircuitPython")): |
604 | 614 | return [] |
|
0 commit comments