aspect-build / aspect-build/rules_js

[Bug]: `public_hoist_packages` does not fail repository setup if requested hash does not exist

Open
#1,370 1 comment 0 reactions 0 assignees View on GitHub
bug help wanted
Dominant language
Starlark
Stars
378
Forks
183
Avg merge
1d 9h
Merged PRs (30d)
32

Description

### What happened?

Bad setup
![image](https://github.com/aspect-build/rules_js/assets/3680126/60a35a77-e12d-4f63-99e4-cb89ddc18105)

Good Setup
![image](https://github.com/aspect-build/rules_js/assets/3680126/21e70a64-dbc7-499c-901a-711ac861c646)

We had a scenario where we were pinning a dep with `public_hoist_packages` and the packages ended up deduping in the lockfile. This meant that we no longer needed the hash. However, rules_js failed to catch that the hash'ed dep no longer existed and continued to build. This led to us having a binary go out that was missing a dependency and broke for some internal sites for end users.

The expected behavior should be if a requested dep from `public_hoist_packages` does not exist, it should fail the build and notify the user

### Version

Development (host) and target OS/architectures:

Output of `bazel --version`: 6.3.0

Version of the Aspect rules, or other relevant rules from your
`WORKSPACE` or `MODULE.bazel` file:

Language(s) and/or frameworks involved:
rules_js: `61616ef5e932c2ad5f76aefa2badcc700bca7e13`

### How to reproduce

```shell
See description above
```

### Any other information?

_No response_

Contributor guide

Open the contributing guide

Research direction

Start by searching the repository for public_hoist_packages and the repository setup path, then reproduce the missing-hash case described in the issue. Done means setup fails with a user-facing error when a requested hash is absent, with regression coverage if the existing test structure supports it.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript
Domain
build-system
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.