@adobe/helix-config 3.7.0 → 3.7.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -1,3 +1,10 @@
1
+ ## [3.7.1](https://github.com/adobe/helix-config/compare/v3.7.0...v3.7.1) (2024-07-17)
2
+
3
+
4
+ ### Bug Fixes
5
+
6
+ * include head surrogate key ([#137](https://github.com/adobe/helix-config/issues/137)) ([02cc43a](https://github.com/adobe/helix-config/commit/02cc43aa1a948c69a79f0256ebd90029cfe65f3a)), closes [#135](https://github.com/adobe/helix-config/issues/135)
7
+
1
8
  # [3.7.0](https://github.com/adobe/helix-config/compare/v3.6.3...v3.7.0) (2024-07-17)
2
9
 
3
10
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@adobe/helix-config",
3
- "version": "3.7.0",
3
+ "version": "3.7.1",
4
4
  "description": "Helix Config",
5
5
  "main": "src/index.js",
6
6
  "types": "src/index.d.ts",
@@ -257,13 +257,17 @@ async function resolveConfig(ctx, rso, scope) {
257
257
  return config;
258
258
  }
259
259
 
260
- async function getSurrogateKey(opts, profile) {
260
+ async function getSurrogateKey(opts, config) {
261
261
  const { site, org } = opts;
262
+ const profile = config?.extends?.profile;
262
263
  const keys = [
263
264
  await computeSurrogateKey(`${org}_config.json`),
264
265
  ];
265
266
  if (site) {
266
267
  keys.push(await computeSurrogateKey(`${site}--${org}_config.json`));
268
+ if (config?.code?.owner && config?.code?.repo && opts.scope === SCOPE_PIPELINE) {
269
+ keys.push(`${opts.ref}--${config.code.repo}--${config.code.owner}_head`);
270
+ }
267
271
  }
268
272
  if (profile) {
269
273
  keys.push(await computeSurrogateKey(`p:${profile}--${org}_config.json`));
@@ -359,7 +363,7 @@ export async function getConfigResponse(ctx, opts) {
359
363
  const rso = { ref, site, org };
360
364
  const config = await resolveConfig(ctx, rso, scope);
361
365
  const surrogateHeaders = {
362
- 'x-surrogate-key': await getSurrogateKey(opts, config?.extends?.profile),
366
+ 'x-surrogate-key': await getSurrogateKey(opts, config),
363
367
  };
364
368
  if (!config) {
365
369
  return new PipelineResponse('', {