Skip to content

Fabisev/artifact publishing #149

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

Draft
wants to merge 28 commits into
base: main
Choose a base branch
from
Draft

Conversation

fabisev
Copy link
Contributor

@fabisev fabisev commented Aug 19, 2025

Issue #, if available:

Description of changes:

  • Added build, test and publish workflow that uses Codebuild
  • Added copyright headers verifier and adder
  • Added automatic changelog generation
  • Added script for local testing

Target (OCI, Managed Runtime, both):
both

Checklist

  • I have run npm install to generate the package-lock.json correctly and included it in the PR.

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

@@ -0,0 +1,135 @@
name: Build and Release

Choose a reason for hiding this comment

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

I see the general flow of this is different from what we did

  • We are not using npmrc
  • We are not specific scope modifier --access=public

if [[ "${{ steps.version.outputs.is_rc }}" == "true" ]]; then
npm publish aws-lambda-ric-*.tgz --tag rc
else
npm publish aws-lambda-ric-*.tgz

Choose a reason for hiding this comment

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

We publish for 2 arch -> We cannot use 1 tar file for it

@@ -0,0 +1,113 @@
#!/usr/bin/env node

Choose a reason for hiding this comment

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

For adding things like Copyright header the most classic tool is git diff - It's market practise - Let's reuse that and not language specific tools - Good thought of adding this as part of linting, I hat when build/automated review fail due to this:P!

@@ -0,0 +1,97 @@
#!/usr/bin/env node

Choose a reason for hiding this comment

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

Why do we need this if we are specifying executable before starting script

# Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
# SPDX-License-Identifier: Apache-2.0

set -e

Choose a reason for hiding this comment

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

For ease of debugging on this failing we can optionally do

set -euo pipefail
trap 'echo "Error on line $LINENO"; exit 1' ERR

local node_version=$1
echo "Running unit tests for Node.js $node_version..."
docker build -f test/unit/Dockerfile.nodejs${node_version}.x -t unit/nodejs.${node_version}x .
docker run --rm unit/nodejs.${node_version}x

Choose a reason for hiding this comment

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

For checking failures

docker run … || { echo "Tests failed for Node.js $node_version"; exit 1; }

@@ -0,0 +1,36 @@
#!/bin/bash

Choose a reason for hiding this comment

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

In general for formatting bash doesn't care but we need to add formatting for ease in readability

"all")
echo "Running unit tests for all Node versions..."
for version in 18 20 22; do
run_unit_tests $version

Choose a reason for hiding this comment

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

nit: Consider running them concurrently like command & => Only downside logs are interleaved which will make debugging hard

@fabisev fabisev marked this pull request as draft August 20, 2025 18:25
@fabisev fabisev force-pushed the fabisev/artifact-publishing branch 7 times, most recently from 8d292b5 to 2e64bbd Compare August 20, 2025 19:52
@fabisev fabisev force-pushed the fabisev/artifact-publishing branch from 2e64bbd to bdb6bf1 Compare August 20, 2025 19:57
@fabisev fabisev force-pushed the fabisev/artifact-publishing branch from d0e6613 to 523de7c Compare August 21, 2025 10:25
@fabisev fabisev force-pushed the fabisev/artifact-publishing branch from b3dfd05 to 160d714 Compare August 21, 2025 11:19
first_line=$(head -n1 "$file" 2>/dev/null || echo "")

# Create patch entry
echo "--- a/$file" >> "$patch_file"
Copy link
Member

Choose a reason for hiding this comment

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

Patch file itself could be created beforehand?

fi

# Create patch entry
echo "--- a/$file" >> "$patch_file"
Copy link
Member

Choose a reason for hiding this comment

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

Same question here, we don't need to create the patch file on the fly

@fabisev fabisev force-pushed the fabisev/artifact-publishing branch from 3471e1c to 595e7e8 Compare August 21, 2025 16:23
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.

3 participants