Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[SPIKE] - "pepr build --no-embed" flag writes stderr stream with exitcode 0 #1659

Closed
btlghrants opened this issue Jan 14, 2025 · 0 comments · Fixed by #1731
Closed

[SPIKE] - "pepr build --no-embed" flag writes stderr stream with exitcode 0 #1659

btlghrants opened this issue Jan 14, 2025 · 0 comments · Fixed by #1731
Assignees
Milestone

Comments

@btlghrants
Copy link
Contributor

btlghrants commented Jan 14, 2025

Background

While working #1654 I discovered that we get strange text on stderr when running the pepr build command with the --no-embed flag:

The module still appears to build (successfully, maybe..?).
The build command returns an exit code of "0".
The stdout stream comes back empty.
The stderr stream comes back with containing an error like: "Error: Cannot find module [...])

This should be investigated. Current behavior codified in (upcoming) integration test for the pepr build cli:

  • /integration/cli/build.noembed.test.ts : build > builds a module > for use as a library > builds

Definition of Done

  1. figure out whether this is a "real" error or just a matter of test setup / config, and
  2. fix the error (if it is one).
@btlghrants btlghrants converted this from a draft issue Jan 14, 2025
@btlghrants btlghrants added the bug Something isn't working label Jan 14, 2025
@btlghrants btlghrants changed the title --no-embed flag writes to stderr stream even when successful --no-embed flag writes stderr stream with exitcode 0 Jan 14, 2025
@btlghrants btlghrants moved this from 📋 Backlog to 🆕 New in Pepr Project Board Jan 14, 2025
@btlghrants btlghrants changed the title --no-embed flag writes stderr stream with exitcode 0 "pepr build --no-embed" flag writes stderr stream with exitcode 0 Jan 14, 2025
@btlghrants btlghrants moved this from 🆕 New to Questions in Pepr Project Board Jan 14, 2025
@btlghrants btlghrants removed the bug Something isn't working label Jan 14, 2025
@cmwylie19 cmwylie19 moved this from Questions to 📋 Backlog in Pepr Project Board Jan 15, 2025
@cmwylie19 cmwylie19 changed the title "pepr build --no-embed" flag writes stderr stream with exitcode 0 [SPIKE] - "pepr build --no-embed" flag writes stderr stream with exitcode 0 Jan 15, 2025
@cmwylie19 cmwylie19 modified the milestones: v0.44.0, v0.45.0 Jan 21, 2025
@cmwylie19 cmwylie19 self-assigned this Jan 24, 2025
@cmwylie19 cmwylie19 moved this from 📋 Backlog to 🏗 In progress in Pepr Project Board Jan 24, 2025
github-merge-queue bot pushed a commit that referenced this issue Jan 28, 2025
## Description

When running a build using `--no-embed` the build should _not_ generate
the Pepr module as a secret as used during typical builds. As we were
working towards reducing statements in the build file a function was
created to handle the embed option and stop execution. This PR updates
the function to stop execution which was causing the command to write to
`stdErr`

While implementing this fix I encountered errors and needed to satisfy
eslint configs
```bash
src/cli/build.ts
  131:13  warning  Async arrow function has too many statements (21). Maximum allowed is 20  max-statements
  131:13  warning  Async arrow function has a complexity of 11. Maximum allowed is 10        complexity
```


## Related Issue

Fixes #1659 
<!-- or -->
Relates to #

## Type of change

- [ ] Bug fix (non-breaking change which fixes an issue)
- [ ] New feature (non-breaking change which adds functionality)
- [x] Other (security config, docs update, etc)

## Checklist before merging
- [x] Unit,
[Journey](https://github.com/defenseunicorns/pepr/tree/main/journey),
[E2E Tests](https://github.com/defenseunicorns/pepr-excellent-examples),
[docs](https://github.com/defenseunicorns/pepr/tree/main/docs),
[adr](https://github.com/defenseunicorns/pepr/tree/main/adr) added or
updated as needed
- [x] [Contributor Guide
Steps](https://docs.pepr.dev/main/contribute/#submitting-a-pull-request)
followed

---------

Signed-off-by: Case Wylie <[email protected]>
Co-authored-by: Barrett <[email protected]>
Co-authored-by: Sam Mayer <[email protected]>
@github-project-automation github-project-automation bot moved this from 🏗 In progress to ✅ Done in Pepr Project Board Jan 28, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: ✅ Done
Development

Successfully merging a pull request may close this issue.

2 participants