Skip to content

Commit

Permalink
Merge branch 'main' into cottsay/repo-context
Browse files Browse the repository at this point in the history
  • Loading branch information
cottsay committed Sep 20, 2024
2 parents 97354ad + a3225c3 commit 37586f1
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 5 deletions.
7 changes: 4 additions & 3 deletions action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,15 +13,16 @@ runs:
- name: Set up rosdistro-reviewer
shell: bash
run: |
python -m venv .rosdistro-reviewer-venv
. .rosdistro-reviewer-venv/bin/activate
python -m venv ${{ runner.temp }}/.rosdistro-reviewer-venv
. ${{ runner.temp }}/.rosdistro-reviewer-venv/bin/activate
python -m pip install "${{ github.action_path }}[github]" --quiet
- name: Generate automated review
shell: bash
run: |
. .rosdistro-reviewer-venv/bin/activate
. ${{ runner.temp }}/.rosdistro-reviewer-venv/bin/activate
rosdistro-reviewer \
--log-base /dev/null \
--log-level DEBUG \
--target-ref ${{ github.event.pull_request.base.sha }} \
--head-ref ${{ github.event.pull_request.head.sha }} \
--github-pull-request \
Expand Down
2 changes: 1 addition & 1 deletion rosdistro_reviewer/element_analyzer/rosdep.py
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ def _check_key_names(criteria, annotations, changed_rosdeps, key_counts):
problems.add(
"Keys which contain only pip rules should end in '-pip'")
annotations.append(Annotation(
'rosdep/python.yaml',
file,
k.__lines__,
f"This key should{'' if pip_only else ' not'} "
"end in '-pip'"))
Expand Down
5 changes: 4 additions & 1 deletion rosdistro_reviewer/yaml_changes.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
# Copyright 2024 Open Source Robotics Foundation, Inc.
# Licensed under the Apache License, Version 2.0

from pathlib import Path
from pathlib import PurePosixPath
from typing import Any
from typing import Iterable
from typing import Mapping
Expand Down Expand Up @@ -83,8 +85,9 @@ def get_changed_yaml(
if head_ref is not None:
with Repo(path) as repo:
for yaml_path in paths:
git_yaml_path = str(PurePosixPath(Path(yaml_path)))
data[yaml_path] = yaml.load(
repo.tree(head_ref)[yaml_path].data_stream,
repo.tree(head_ref)[git_yaml_path].data_stream,
Loader=AnnotatedSafeLoader)
else:
for yaml_path in paths:
Expand Down

0 comments on commit 37586f1

Please sign in to comment.