question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Packing of layers is broken

See original GitHub issue

/cc @juanjoDiaz

Folow up to https://github.com/serverless/serverless/pull/8602, where layer packaging issue was put to light

Related bugs: #5583, #5892 and #7837

Currently layers are packaged taking into package include and exclude patterns as defined on service level package property and on layer layers[].package property.

Still glob patterns are resolved against layer path, so service level patterns in a bad way influence what’s being packaged for layer, and that often leads to bugs and unexpected results

Proposed fix

I believe we should either:

  1. Ignore service level patterns when packaging the layer (respect purely layer level patterns). Downside is that we may break packaging for users, which by chance rely on current behavior (still I hope that’ll be rare)
  2. Package against service folder, but prepand patterns with ['!**', layerPath] and map layer level pattenrs to${layerPath}/**/${layerPattern}. Still I’m not 100% sure weather it’s fully safe

At this point I’m leaning towards (1), as it will make configuration less confusing (it’s more intuitive to assume that include and exclude patterns as set in layer context will be applied against layer directory and not service directory).

Issue Analytics

  • State:open
  • Created 3 years ago
  • Comments:5 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
medikoocommented, Dec 11, 2020

This is a breaking change though.

It can be breaking for users which put on service level patterns which they expected to work against layer path, while I think in general users didn’t expect patterns to work that way (when they found, it works that way, they started to introduce workarounds to reverse effect of patterns in service, like here: https://github.com/serverless/serverless/issues/5583).

Also I think we never documented that patterns from service were taken into account.

I’d treat it as bug fix that’s worth addressing upfront, and I’d expect that if it’ll break for some it’ll be really rare.

0reactions
juanjoDiazcommented, Dec 11, 2020

I’ll create the PR after #8581 is merged or they would conflict.

Read more comments on GitHub >

github_iconTop Results From Across the Web

The Layers of Packaging: What Is The Difference Between ...
Learn all about the layers of packaging and how to optimize each layer for your product, customer and supply chain journey.
Read more >
Biggest Packing Mistakes from Moving Experts - MYMOVE
Not layering your box properly.​​ To start off, layer the bottom of the box with packing peanuts to protect items without taking up...
Read more >
Your Guide to Shipping Fragile Items - ShippingEasy
We're classifying fragile items as breakable items and/or items that need special packaging for shipping. These items need multiple layers ...
Read more >
Repair broken data sources for layers and tables—ArcGIS Pro
You can repair broken data links for layers or stand-alone tables by clicking the red exclamation point to open the Change Data Source...
Read more >
Techniques for Improving Pallet Density & Stability - FreightSnap
How to Pack Your Pallet: Techniques for Improving Pallet Density & Stability ... a pallet, remember that heavy items should be placed on...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found