microsoft / microsoft/lage

Patterns in inputs that reference files outside the package are silently ignored

Open
#869 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
TypeScript
Stars
816
Forks
88
PR merge metrics
No merged PRs in 30d

Description

Describe the bug
I had been providing relative paths and absolute paths in the inputs array to a task, but it doesn't seem to run the task again when these files are changed. Looking at the source code I realized that it only processes inputs of a package using globs against files that it has found in that package based on a git list-files operation.

This means that the inputs currently can only reference files that are inside that package. You can't use absolute paths and you cannot use relative paths starting with ../ to use files from another package as an input.

Currently for not particularly great reasons I was passing paths with ../ since we have a tool that runs in a package that needs to reference files from other packages and it doesn't use node style import resolution.

Also for tasks that use a worker I wanted to make the task depend on the worker script by providing the absolute path to that worker script.

Note that my change in https://github.com/microsoft/lage/pull/867 might fix this in the case where the inputs element does not have a wildcard.

I think that if relative and absolute paths are not supported, the software should give an error if it detects a relative or absolute path in the inputs array. It would be nice to support them, though.

To Reproduce

Create a task which has inputs elements that are either relative , e.g. ../packagename/package.json or aboslute, e.g. path.join(__dirname, 'scripts/babel-worker.cjs').

Expected behavior

It should not silently fail in these cases - either they would be supported or it would reject them with an error.

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by tracing how task inputs are matched against files returned by the git list-files operation, including the wildcard behavior discussed in pull request #867. Reproduce the issue with ../packagename/package.json and an absolute worker-script path. Done means these inputs are either handled correctly or rejected with an explicit error instead of being silently ignored.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript
Domain
build-system, tooling
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.