Skip to content

Develop#27

Merged
Zaiidmo merged 17 commits intomasterfrom
develop
Mar 12, 2026
Merged

Develop#27
Zaiidmo merged 17 commits intomasterfrom
develop

Conversation

@Zaiidmo
Copy link
Contributor

@Zaiidmo Zaiidmo commented Mar 12, 2026

Summary

  • What does this PR change?

Why

  • Why is this change needed?

Checklist

  • Added/updated tests (if behavior changed)
  • npm run lint passes
  • npm run typecheck passes
  • npm test passes
  • npm run build passes
  • Added a changeset (npx changeset) if this affects consumers

Notes

  • Anything reviewers should pay attention to?

y-aithnini and others added 17 commits February 23, 2026 15:55
- Replace GitHub Actions version tags with full commit SHA hashes (v6 -> fd88b7d, v1 -> d304d05)
- Fix SONAR_PROJECT_KEY from LoggingKit to NotificationKit
- Add 'main' branch to PR trigger list for release-check workflow
- Resolves 2 security hotspots (githubactions:S7637) for supply chain security
- Add explicit NotificationDocument type annotations to map callbacks
- Fix mapToRecord signature to accept any type (handles both Map and Record)
- Install mongoose as dev dependency for type checking
- Fixes pre-push typecheck failures
- Add comprehensive instruction files in .github/instructions/
- Includes copilot, testing, bugfix, features, general guidelines
- Standardize documentation across all repositories
- Remove deprecated instruction files from .github/ root
- Consolidate all docs in .github/instructions/ directory
- Improve documentation organization
- Mongoose required for type compilation (infra/repositories/mongoose)
- ts-node required by Jest configuration
- Resolves typecheck and test errors
@Zaiidmo Zaiidmo requested review from a team and Copilot March 12, 2026 09:32
@Zaiidmo Zaiidmo merged commit bce0ed7 into master Mar 12, 2026
2 checks passed
@Zaiidmo Zaiidmo deleted the develop branch March 12, 2026 09:32
@Zaiidmo Zaiidmo restored the develop branch March 12, 2026 09:32
@sonarqubecloud
Copy link

Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR updates the package version and tightens the NPM publishing GitHub Actions workflow by adding tag/version validation to ensure releases are tied to a semver tag and match package.json.

Changes:

  • Bumped package version from 0.0.00.0.1 (and updated package-lock.json accordingly).
  • Enhanced the publish workflow to validate semver tag format and ensure tag version matches package.json.
  • Updated package-lock.json dependency resolutions as part of the lockfile regeneration.

Reviewed changes

Copilot reviewed 2 out of 3 changed files in this pull request and generated 6 comments.

File Description
package.json Bumps package version to 0.0.1.
package-lock.json Updates lockfile version fields and refreshes some dependency resolutions.
.github/workflows/publish.yml Adds tag discovery + semver/tag-to-package.json version validation before publishing.

Comment on lines +25 to +27
# Try to find a version tag on HEAD or recent commits
TAG=$(git describe --exact-match --tags HEAD 2>/dev/null || git tag --list --sort=-version:refname --merged HEAD 'v*.*.*' | head -1 || echo "")

Copy link

Copilot AI Mar 12, 2026

Choose a reason for hiding this comment

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

This workflow no longer guarantees the HEAD commit is tagged: it falls back to the most recent merged v*.*.* tag, so a push to master without a new tag can still pass validation and attempt to publish again (likely failing with “version already exists” or, worse, publishing from an untagged commit). Consider requiring an exact tag on HEAD and/or triggering the workflow on push to tags: ['v*.*.*'] so the published commit is always the tagged one.

Copilot uses AI. Check for mistakes.

echo "✅ Valid tag found: $TAG"
echo "✅ Version matches package.json: $PKG_VERSION"
echo "TAG_VERSION=$TAG" >> $GITHUB_ENV
Copy link

Copilot AI Mar 12, 2026

Choose a reason for hiding this comment

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

TAG_VERSION is computed without the v prefix, but the value exported to $GITHUB_ENV is $TAG (still includes the v prefix). This makes the env var name misleading and can break later steps that expect a pure semver (e.g., 0.0.1). Export the actual TAG_VERSION value (or rename the variable to TAG).

Suggested change
echo "TAG_VERSION=$TAG" >> $GITHUB_ENV
echo "TAG_VERSION=$TAG_VERSION" >> $GITHUB_ENV

Copilot uses AI. Check for mistakes.

# Extract version from tag
TAG_VERSION="${TAG#v}" # Remove 'v' prefix
PKG_VERSION=$(grep '"version"' package.json | head -1 | sed 's/.*"version": "\([^"]*\)".*/\1/')
Copy link

Copilot AI Mar 12, 2026

Choose a reason for hiding this comment

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

Parsing package.json with grep | sed is brittle (formatting changes, comments, or additional "version" fields can break it). Prefer a structured read (e.g., node -e with JSON.parse, npm pkg get version, or jq -r .version) to make the version check reliable.

Suggested change
PKG_VERSION=$(grep '"version"' package.json | head -1 | sed 's/.*"version": "\([^"]*\)".*/\1/')
PKG_VERSION=$(node -p "require('./package.json').version")

Copilot uses AI. Check for mistakes.
Comment on lines +31 to +40
echo "This typically happens when:"
echo " 1. You forgot to run 'npm version patch|minor|major' on develop"
echo " 2. You didn't push tags when merging develop→master"
echo " 3. PR merge didn't include the tag from develop"
echo ""
echo "📋 Correct workflow:"
echo " 1. On develop: npm version patch (or minor/major)"
echo " 2. On develop: git push origin develop --tags"
echo " 3. Create PR develop→master and merge"
echo " 4. Workflow automatically triggers on master with the tag"
Copy link

Copilot AI Mar 12, 2026

Choose a reason for hiding this comment

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

The failure message recommends npm version patch|minor|major, but this repo is already set up for Changesets (.changeset/ directory and changeset/version-packages scripts in package.json). This guidance is likely to confuse the intended release flow—either update the message to the actual Changesets-based commands, or remove/disable Changesets if it’s not the chosen approach.

Copilot uses AI. Check for mistakes.
{
"name": "@ciscode/notification-kit",
"version": "0.0.0",
"version": "0.0.1",
Copy link

Copilot AI Mar 12, 2026

Choose a reason for hiding this comment

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

This PR directly bumps package.json version, but the repository is configured for Changesets-based versioning (see changeset/version-packages scripts and .changeset/ config). If Changesets is the intended release mechanism, the version should typically be updated via changeset version (driven by changeset files) rather than manual edits, to avoid divergence between changesets and published versions.

Copilot uses AI. Check for mistakes.
{
"name": "@ciscode/notification-kit",
"version": "0.0.0",
"version": "0.0.1",
Copy link

Copilot AI Mar 12, 2026

Choose a reason for hiding this comment

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

PR description is still the default template (no Summary/Why/Notes filled in), which makes it hard to validate intent and release impact (especially around versioning/publishing). Please add a short summary of what’s being released and why, and call out the intended versioning approach (Changesets vs npm version).

Copilot uses AI. Check for mistakes.
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