mirror of
https://github.com/floci-io/floci.git
synced 2026-11-23 06:00:46 -05:00
* feat(redshiftserverless): add namespace lifecycle Amazon Redshift Serverless was absent entirely: every call returned UnknownOperationException, so Terraform's aws_redshiftserverless_namespace could not be planned or applied against Floci. Add a JSON 1.1 service under the RedshiftServerless. target prefix with CreateNamespace, GetNamespace, ListNamespaces, UpdateNamespace, and DeleteNamespace. Namespaces are account and Region scoped and stored through StorageFactory. AWS defaults are applied on create (dbName dev, kmsKeyId AWS_OWNED_KMS_KEY, empty logExports, status AVAILABLE), adminUserPassword is accepted and never returned, DeleteNamespace returns the removed namespace with status DELETING, and UpdateNamespace applies only the supplied fields. Workgroups, snapshots, and the tagging operations remain unemulated. * feat(redshiftserverless): add namespace tagging operations Terraform's aws_redshiftserverless_namespace calls ListTagsForResource on every read once tags are involved, so the namespace lifecycle alone left the resource broken as soon as a config set tags. Add ListTagsForResource, TagResource, and UntagResource. Lookup is by resourceArn rather than namespace name, scoped to the caller's Region, since that is how AWS keys these operations; the namespace is currently the only taggable Redshift Serverless resource, so any other ARN is reported absent. TagResource merges into the existing tags, UntagResource removes by key, and tags passed to CreateNamespace are readable back and survive UpdateNamespace. * fix(redshiftserverless): emit creationDate as ISO-8601 per the API model The awsJson1.1 default is epoch seconds and 133 call sites use it, but this model overrides it: TimestampFormatTrait ISO_8601 on creationDate (and on all eleven other timestamp members in the package, audited). Strict clients broke on the number: Terraform's Go SDK failed to decode and orphaned the created namespace outside state; the Java SDK failed to unmarshall. Only botocore's lenient parsing let CLI checks pass. Emitted via the repo's millisecond-ISO idiom; format pinned by regex in the integration test and by a new handler-level unit test class covering the wire layer that had none (timestamp shape, nextToken emission, maxResults type guard). Checklist note added to AGENTS.md + CONTRIBUTING.md so the next service checks the trait before reaching for the epoch idiom. * docs(redshiftserverless): the ISO-8601 rule is per member, not model-wide Review follow-up: the earlier claim that every timestamp member in this model carries TimestampFormatTrait(ISO_8601) is wrong — 15 of the model's 30 INSTANT members carry no trait and fall back to the awsJson1.1 epoch default. The shipped code is unaffected (creationDate, the only timestamp emitted, is genuinely ISO_8601), but the claim was load-bearing guidance: whoever adds snapshots or scheduled actions next would have applied ISO-8601 to trait-free members and reintroduced the bug in the opposite direction. Narrowed in all four places it appeared. * fix(redshiftserverless): validate collection types, copy-on-update; drop em dashes A present iamRoles, logExports, tags or tagKeys member that was not a JSON array parsed to null and was then indistinguishable from an omitted member, so a malformed UpdateNamespace silently kept the stored value and returned 200 instead of reporting the request as invalid. Only a missing or null member now means "omitted"; a present member of the wrong type, or a collection holding a non-string element, is a ValidationException naming the member. updateNamespace mutated the stored Namespace in place while GetNamespace and ListNamespaces read without taking the same monitor, so a concurrent reader could observe a torn object with some fields updated and some not. Build the new state on a copy and store that instead, which also makes the write-back explicit. The same in-place mutation was present in tagResource, untagResource and deleteNamespace, so all four now copy. Merge semantics are unchanged. Replace the em dashes in the timestamp guidance with commas and periods, per the repository ban. * fix(redshiftserverless): reject Redshift reserved words as namespace names CreateNamespace rejects a namespace name that is an Amazon Redshift SQL reserved word, so names like select or user passed the length and [a-z0-9-] checks here and were persisted. Add the documented reserved word list to the shared namespace-name validator, which create, get, update and delete all reach, so the rejection is consistent.