Skip to content

Commit

Permalink
Accept action-server.yaml wherever conda.yaml is accepted. robot.yaml…
Browse files Browse the repository at this point in the history
… still required as usual.
  • Loading branch information
fabioz committed Jan 23, 2024
1 parent 3f63c3f commit 1c2f3d5
Show file tree
Hide file tree
Showing 6 changed files with 9 additions and 8 deletions.
6 changes: 3 additions & 3 deletions robocorp-code/src/robocorp_code/_lint.py
Original file line number Diff line number Diff line change
Expand Up @@ -134,9 +134,9 @@ def _do_lint(self) -> None:
is_saved = self.is_saved
doc_uri = self.doc_uri

if doc_uri.endswith("conda.yaml") or doc_uri.endswith("robot.yaml"):
if doc_uri.endswith(("conda.yaml", "action-server.yaml")) or doc_uri.endswith("robot.yaml"):
robot_yaml_fs_path = uris.to_fs_path(doc_uri)
if robot_yaml_fs_path.endswith("conda.yaml"):
if robot_yaml_fs_path.endswith(("conda.yaml", "action-server.yaml")):
p = os.path.dirname(robot_yaml_fs_path)
for _ in range(3):
target = os.path.join(p, "robot.yaml")
Expand Down Expand Up @@ -167,7 +167,7 @@ def _do_lint(self) -> None:
found = []
# Ok, we started collecting RCC diagnostics in a thread. We
# can now also collect other diagnostics here.
if doc_uri.endswith("conda.yaml"):
if doc_uri.endswith(("conda.yaml", "action-server.yaml")):
if robocorp_language_server is not None:
ws = robocorp_language_server.workspace
if ws is not None:
Expand Down
2 changes: 1 addition & 1 deletion robocorp-code/src/robocorp_code/deps/analyzer.py
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ def __init__(
):
"""
Args:
contents: The contents of the conda.yaml.
contents: The contents of the conda.yaml/action-server.yaml.
path: The path for the conda yaml.
"""
from ._conda_deps import CondaDeps
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -605,7 +605,7 @@ def get_conda_config_path(

conda_config_path = parent / conda_config
if not conda_config_path.exists():
log.critical("conda.yaml does not exist in %s", conda_config_path)
log.critical(f"{conda_config} (defined from condaConfigFile) does not exist in %s", conda_config_path)
return None

return conda_config_path
Expand Down
3 changes: 2 additions & 1 deletion robocorp-code/src/robocorp_code/rcc.py
Original file line number Diff line number Diff line change
Expand Up @@ -890,8 +890,9 @@ def get_robot_yaml_env_info(
broken_action_result = self.broken_conda_configs.get(
formatted_conda_yaml_contents
)

if broken_action_result is not None:
msg = f"Environment from previously broken conda.yaml requested: {conda_yaml_path}.\n-- VSCode restart required to retry."
msg = f"Environment from previously broken {conda_yaml_path.name} requested: {conda_yaml_path}.\n-- VSCode restart required to retry."
log.critical(msg)
return ActionResult(False, msg, None)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1152,7 +1152,7 @@ def m_text_document__hover(self, **kwargs) -> Any:
return require_monitor(
partial(self._hover_on_locators_json, doc_uri, line, col)
)
if fspath.endswith("conda.yaml"):
if fspath.endswith(("conda.yaml", 'action-server.yaml')):
return require_monitor(
partial(self._hover_on_conda_yaml, doc_uri, line, col)
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -224,7 +224,7 @@ def mark_invalid(message):
)
if not conda_yaml_path:
return mark_invalid(
f"Unable to resolve conda.yaml related to {robot_yaml}"
f"Unable to resolve `condaConfigFile` related to {robot_yaml}"
)

try:
Expand Down

0 comments on commit 1c2f3d5

Please sign in to comment.