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

fix: prevent duplicate artifact assignment #1245

Merged
merged 3 commits into from
Sep 26, 2022
Merged

fix: prevent duplicate artifact assignment #1245

merged 3 commits into from
Sep 26, 2022

Conversation

NoxHarmonium
Copy link
Contributor

@NoxHarmonium NoxHarmonium commented Sep 20, 2022

What did you implement:

Prevent duplicate artifact assignment, extracted some duplicate logic.

Closes #1242

How did you implement it:

Some minor refactoring so that code paths are not called twice redundantly (see issue #1242)

Old Coverage:


=============================== Coverage summary ===============================
Statements   : 95.92% ( 2566/2675 )
Branches     : 89.67% ( 530/591 )
Functions    : 98.18% ( 108/110 )
Lines        : 95.92% ( 2566/2675 )
================================================================================

New Coverage:

=============================== Coverage summary ===============================
Statements   : 95.95% ( 2584/2693 )
Branches     : 89.71% ( 532/593 )
Functions    : 98.19% ( 109/111 )
Lines        : 95.95% ( 2584/2693 )
================================================================================

How can we verify it:

  1. Run sls package --verbose with individual packaging switched on.
  2. Grep for "Setting artifact for function"
  3. Check that each function is only mentioned once

I have tested this in my local project and it works for me.

Todos:

  • Write tests
  • Write documentation
  • Fix linting errors
  • Make sure code coverage hasn't dropped
  • Provide verification config / commands / resources
  • Enable "Allow edits from maintainers" for this PR
  • Update the messages below

Is this ready for review?: YES
Is it a breaking change?: NO

Copy link
Member

@j0k3r j0k3r left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good job, just found a small typo 👍🏼

lib/packageModules.js Outdated Show resolved Hide resolved
@j0k3r j0k3r requested a review from vicary September 20, 2022 07:36
@j0k3r j0k3r added this to the 5.9.2 milestone Sep 20, 2022
NoxHarmonium and others added 2 commits September 24, 2022 11:05
- Extracted some duplicated logic to utils and added test
Co-authored-by: Jérémy Benoist <[email protected]>
@NoxHarmonium
Copy link
Contributor Author

Typo fixed and branch rebased!

Copy link
Member

@vicary vicary left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@j0k3r j0k3r changed the title fix: prevent duplicate artifact assignment (#1242) fix: prevent duplicate artifact assignment Sep 26, 2022
@j0k3r j0k3r enabled auto-merge September 26, 2022 05:02
@j0k3r j0k3r merged commit 48e7aea into serverless-heaven:master Sep 26, 2022
@j0k3r j0k3r mentioned this pull request Sep 26, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Duplicate "Setting artifact for function" logs (possible redundant calls to setArtifactPath?)
3 participants