Skip to content
This repository was archived by the owner on Feb 6, 2026. It is now read-only.
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 24 additions & 2 deletions bin/clover/src/pipelines/aws/pipeline-steps/pruneCfAssets.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,11 @@ import { createFunc, strippedBase64 } from "../../../spec/funcs.ts";
import { CODE_GENERATION_FUNC_SPECS } from "../funcs.ts";
import { ulid } from "https://deno.land/x/ulid@v0.3.0/mod.ts";
import { FuncArgumentSpec } from "../../../bindings/FuncArgumentSpec.ts";
import {
createScalarProp,
ExpandedPropSpecFor,
findPropByName,
} from "../../../spec/props.ts";

const logger = _logger.ns("pruneCfAssets").seal();

Expand All @@ -12,11 +17,11 @@ export function pruneCfAssets(specs: ExpandedPkgSpec[]): ExpandedPkgSpec[] {
const [schema] = spec.schemas;
const [variant] = schema.variants;

if (!spec.name.includes("::") || variant.superSchema.handlers) {
if (!spec.name.includes("::") || variant.superSchema.handlers?.read) {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I am not sure about this. Why should we change this?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

It adds the prop to the assets that aren't supported by cloudcontrol and also lack the read 'handler' - so if I remove this part, the prop isn't added to 5 assets. If we don't want this I could add overrides to those 5 assets instead?

@sprutton1 sprutton1 Jan 16, 2026 •

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I think we had this way originally as no handlers meant no support, but I suppose read only could mean the same thing
I guess we've always had these wrong then?

continue;
}

logger.debug(`Pruning ${schema.name} because it has no handlers`);
logger.debug(`Pruning ${schema.name} because it has no read handler`);

variant.managementFuncs = [];

Expand All @@ -26,6 +31,23 @@ export function pruneCfAssets(specs: ExpandedPkgSpec[]): ExpandedPkgSpec[] {
CODE_GENERATION_FUNC_SPECS.awsCloudFormationLint.id,
);

// Add CloudFormationOnly prop to extra
const extraProp = findPropByName(
variant.domain,
"extra",
) as ExpandedPropSpecFor["object"];
if (extraProp) {
const cfOnlyProp = createScalarProp(
"CloudFormationOnly",
"boolean",
extraProp.metadata.propPath,
false,
);
cfOnlyProp.data.defaultValue = "true";
cfOnlyProp.data.hidden = true;
extraProp.entries.push(cfOnlyProp);
}

const attrFunc = createAttributeFunc();
spec.funcs.push(attrFunc);
}
Expand Down
Loading