Skip to content

Commit 56ccf2c

Browse files
authored
Merge pull request #115 from sommersoft/travis_countdown
Change Travis Checks to Keep Track of Actions Migration
2 parents cfd2ff5 + 69e3a36 commit 56ccf2c

File tree

1 file changed

+19
-9
lines changed

1 file changed

+19
-9
lines changed

adabot/lib/circuitpython_library_validators.py

+19-9
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,9 @@
3838
ERROR_README_DUPLICATE_ALT_TEXT = "README has duplicate alt text"
3939
ERROR_README_MISSING_DISCORD_BADGE = "README missing Discord badge"
4040
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"
4244
ERROR_PYFILE_DOWNLOAD_FAILED = "Failed to download .py code file"
4345
ERROR_PYFILE_MISSING_STRUCT = ".py file contains reference to import ustruct" \
4446
" without reference to import struct. See issue " \
@@ -104,6 +106,9 @@
104106
ERROR_PYLINT_VERSION_NOT_LATEST = "PyLint version not latest"
105107
ERROR_NEW_REPO_IN_WORK = "New repo(s) currently in work, and unreleased"
106108

109+
# Temp category for GitHub Actions migration.
110+
ERROR_NEEDS_ACTION_MIGRATION = "Repo(s) need to be migrated from TravisCI to GitHub Actions"
111+
107112
# Since this has been refactored into a separate module, the connection to 'output_handler()'
108113
# and associated 'file_data' list is broken. To keep from possibly having conflicted
109114
# file operations, and writing to the `output_filename` concurrently, establish an
@@ -315,7 +320,11 @@ def _validate_readme(self, repo, download_url):
315320
errors.append(ERROR_README_MISSING_RTD_BADGE)
316321

317322
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)
319328

320329
return errors
321330

@@ -364,8 +373,10 @@ def _validate_py_for_u_modules(self, repo, download_url):
364373
return errors
365374

366375
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.
368377
"""
378+
return []
379+
369380
download_url = travis_yml_file_info["download_url"]
370381
contents = requests.get(download_url, timeout=30)
371382
if not contents.ok:
@@ -494,10 +505,7 @@ def validate_contents(self, repo):
494505
readme_info["download_url"]))
495506

496507
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)
501509

502510
if "readthedocs.yml" in files or ".readthedocs.yml" in files:
503511
fn = "readthedocs.yml"
@@ -592,13 +600,15 @@ def validate_contents(self, repo):
592600

593601
return errors
594602

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
597605
CI. This will both check Travis state and attempt to enable Travis CI
598606
and setup the expected state in Travis if not enabled. Expects a
599607
dictionary with a GitHub API repository state (like from the list_repos
600608
function). Returns a list of string error messages for the repository.
601609
"""
610+
return []
611+
602612
if not (repo["owner"]["login"] == "adafruit" and
603613
repo["name"].startswith("Adafruit_CircuitPython")):
604614
return []

0 commit comments

Comments
 (0)