Skip to content

Commit

Permalink
fix(dev): new repo;
Browse files Browse the repository at this point in the history
- Fixed issues with adding repos.
  • Loading branch information
JVickery-TBS committed Dec 10, 2024
1 parent 7331605 commit 950239f
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 6 deletions.
8 changes: 6 additions & 2 deletions docs/source/_templates/layout.html
Original file line number Diff line number Diff line change
Expand Up @@ -113,8 +113,12 @@ <h4 class="change-canada-type-title"><i class="fa {{ type_icons.get(type) }} cha
</ul>
{% endfor %}
{% endif %}
<a class="btn btn-primary btn-sm" target="_blank" href="{{ info.uri }}/compare/{{ info.prev }}...{{ info.head }}">View it on GitHub</a>
<span class="release-hash-label">[{{ info.prev|truncate(12)|replace('...', '') }}...{{ info.head|truncate(12)|replace('...', '') }}]</span>
{% set _prevHash = info.prev %}
{% if not info.prev %}
{% set _prevHash = 'HEAD' %}
{% endif %}
<a class="btn btn-primary btn-sm" target="_blank" href="{{ info.uri }}/compare/{{ _prevHash }}...{{ info.head }}">View it on GitHub</a>
<span class="release-hash-label">[{{ _prevHash|truncate(12)|replace('...', '') }}...{{ info.head|truncate(12)|replace('...', '') }}]</span>
</div>
</div>
{% endfor %}
Expand Down
17 changes: 13 additions & 4 deletions docs/source/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -331,6 +331,9 @@ def parsed_release_hashses():
if repo not in prev_project_stack:
parsed_release_hashses[release][project_name][repo] = {
'message': 'Repository added',
'uri': info['uri'],
'prev': None,
'head': info['hash'],
}
# the commit hash between the releases is different,
# so this is a code release.
Expand Down Expand Up @@ -373,10 +376,16 @@ def parsed_release_hashses():
github_compare_dicts[project_name] = {}

for repo, info in project_stack.items():
endpoint = info['uri'].replace('https://github.com', 'https://api.github.com/repos')
endpoint += '/compare/%s...%s' % (info['prev'], info['head'])
response = requests.get(endpoint)
github_compare_dicts[project_name][repo] = json.loads(response.content)
endpoint = None
if info.get('prev'):
endpoint = info['uri'].replace('https://github.com', 'https://api.github.com/repos')
endpoint += '/compare/%s...%s' % (info['prev'], info['head'])
elif info.get('head'):
endpoint = info['uri'].replace('https://github.com', 'https://api.github.com/repos')
endpoint += '/compare/HEAD...%s' % info['head']
if endpoint:
response = requests.get(endpoint)
github_compare_dicts[project_name][repo] = json.loads(response.content)

# save object to compare file.
os.makedirs(os.path.dirname(github_filename), exist_ok=True)
Expand Down

0 comments on commit 950239f

Please sign in to comment.