Skip to content

Commit

Permalink
Fix custom github repositories failing to parse
Browse files Browse the repository at this point in the history
This commit resolves a type conflicts, which caused exception when parsing
release information of packages, hosted on GitHub.

As a result packages from Github repositories, using tag based releases were
not parsed and thus

1. not published to "Package Control: Install Packages" quick panel.
2. not added to cache, causing them to be re-queried each time the quick panel
   was triggered (see #1645).

Note:

Only Package Control client is effected, which tries to reduce amount of API
calls, by not downloading commit info of each release tag.
  • Loading branch information
deathaxe committed Jul 21, 2023
1 parent 303321f commit 3ce4cfa
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
2 changes: 1 addition & 1 deletion package_control/clients/github_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -187,7 +187,7 @@ def _get_releases(user_repo, tag_prefix=None, page_size=1000):
version, tag, tag_url = release

if is_client:
timestamp = 0
timestamp = '1970-01-01 00:00:00'
else:
tag_info = self.fetch_json(tag_url)
timestamp = tag_info['commit']['committer']['date'][0:19].replace('T', ' ')
Expand Down
5 changes: 3 additions & 2 deletions package_control/providers/repository_provider.py
Original file line number Diff line number Diff line change
Expand Up @@ -787,8 +787,9 @@ def has_broken_release():
# Extract a date from the newest release
date = '1970-01-01 00:00:00'
for release in info['releases']:
if 'date' in release and release['date'] > date:
date = release['date']
release_date = release.get('date')
if release_date and isinstance(release_date, str) and release_date > date:
date = release_date
info['last_modified'] = date

output[info['name']] = info
Expand Down

0 comments on commit 3ce4cfa

Please sign in to comment.