Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
48 commits
Select commit Hold shift + click to select a range
d3dbd6f
forgot include
RMotive Jul 27, 2026
77d7442
Issue #41 - Adding async support for testing methods
jr110 Jul 28, 2026
33f3fd5
Issue #44 - Adding get method in [TestingStoreManager]
jr110 Jul 30, 2026
74e8a47
removing unnecesary sync methods in csm database testing
jr110 Jul 30, 2026
bfeb7c3
pull dev changes
jr110 Oct 3, 2026
c3eed14
testing methods optimizations
jr110 Oct 3, 2026
e934c8d
Summary definitions changes
jr110 Oct 4, 2026
99d09a6
Merge pull request #45 from Cosmos-CSM/dev@issue_41_43
RMotive Oct 4, 2026
3f6fc83
file structuring
RMotive Oct 4, 2026
4dd9ad7
organizing solution
RMotive Oct 5, 2026
fcad98e
Checking project adjustments and content
RMotive Oct 6, 2026
1547493
testing and main project building
RMotive Oct 6, 2026
81437fb
integration tests added pending to check
RMotive Oct 6, 2026
2d78a1c
structuring multi providers
RMotive Oct 13, 2026
2874f86
finishing standarization and ready to go first version
RMotive Oct 16, 2026
cc39754
added unit tests project, correected ci workflow
RMotive Oct 16, 2026
fbcc3c3
updating CI workflow
RMotive Oct 16, 2026
5fdd0a2
fixing CI
RMotive Oct 16, 2026
ddf89b7
updating cd workflows
RMotive Oct 17, 2026
9ff5126
pusing eol validation
RMotive Oct 17, 2026
7fb7b54
trying something else
RMotive Oct 17, 2026
69331f6
adding git attributes
RMotive Oct 17, 2026
68152a6
checking now
RMotive Oct 17, 2026
1305b52
changing approach
RMotive Oct 17, 2026
c9e97f4
applying checks
RMotive Oct 17, 2026
550a46d
trying again
RMotive Oct 17, 2026
53d54dc
updating workflow
RMotive Oct 17, 2026
ac2b368
aother update
RMotive Oct 17, 2026
5c5e6ee
another try
RMotive Oct 17, 2026
9cc6b48
last try
RMotive Oct 17, 2026
a60747e
adding nuget source
RMotive Oct 17, 2026
8a74e3b
Merge pull request #47 from Cosmos-CSM/46-standarize-repository
RMotive Oct 17, 2026
bda649d
removing cd workflows
RMotive Oct 17, 2026
272ae08
Merge branch 'main' into dev
RMotive Oct 17, 2026
ec1741c
adding package metadata and bump checker
RMotive Oct 17, 2026
a98406b
Merge branch 'dev' of https://github.com/Cosmos-CSM/fe_csharp_databas…
RMotive Oct 17, 2026
c24f228
Merge branch 'main' into dev
RMotive Oct 17, 2026
a4f3719
testing workflow to auto-generate release docs
RMotive Oct 19, 2026
42faf8b
corrected a workflow var
RMotive Oct 19, 2026
c9962a2
trying single line approach
RMotive Oct 19, 2026
d8f3654
trying another apporach
RMotive Oct 19, 2026
1502808
testing new version
RMotive Oct 19, 2026
efac5dc
fixed syntax error
RMotive Oct 19, 2026
bcc0f09
fixed syntax
RMotive Oct 19, 2026
5968d63
fixing arguments
RMotive Oct 19, 2026
136cd21
fixed all syntax
RMotive Oct 19, 2026
44317d2
added message
RMotive Oct 19, 2026
1f34a10
fixed ident
RMotive Oct 19, 2026
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
1 change: 1 addition & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
* text eol=crlf
282 changes: 282 additions & 0 deletions .github/workflows/cd-1.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,282 @@
name: CD 1

# This workflow supports the first phase of delvier process, when a PR is opened pointing [main] branch, will trigger validations.
# First will check if all PR opened to [main] are from [dev].
# Then will check that package metadata version was bumped correctly.

on:
workflow_dispatch:

pull_request:
branches:
- main
types:
- opened
- reopened
- synchronize

permissions:
contents: write

jobs:

validate-source:
name: Validate Source Branch
runs-on: ubuntu-latest

steps:
- name: Prevent Sources
run: |
set -euo pipefail
HEAD_REF="${{ github.head_ref }}"
echo "Head Branch: $HEAD_REF"

if [ "$HEAD_REF" = "dev" ]; then
echo "Cannot merge into main from dev branch"
exit 1
fi

if [[ "$HEAD_REF" =~ ^vbump_[0-9]+\.[0-9]+\.[0-9]+(-[A-Za-z0-9._-]+)?$ ]]; then
echo "Name matches version bump"
exit 0
else
echo "Wrong source. Expected: vbump_{version}"
exit 1
fi

compare-versions:
needs: validate-source
name: Compare Versions
runs-on: ubuntu-latest
outputs:
version: ${{ steps.package_metadata.outputs.version }}
packages: ${{ steps.package_metadata.outputs.packages }}

steps:
- name: CheckOut Base
uses: actions/checkout@v3
with:
ref: ${{ github.event.pull_request.base.ref }}
path: base

- name: CheckOut Head
uses: actions/checkout@v3
with:
ref: ${{ github.event.pull_request.head.ref }}
path: head

- name: Read Base version
id: base_version
run: |
VERSION=$(jq -r '.version' base/csmpackage.json)
echo "version=$VERSION" >> $GITHUB_OUTPUT

- name: Read Head version
id: head_version
run: |
VERSION=$(jq -r '.version' head/csmpackage.json)
echo "version=$VERSION" >> $GITHUB_OUTPUT

- name: Compare versions
run: |
BASE="${{ steps.base_version.outputs.version }}"
HEAD="${{ steps.head_version.outputs.version }}"

echo "Base version: $BASE"
echo "Head version: $HEAD"

if [ "$BASE" = "$HEAD" ]; then
echo "Package metadata versions are not bumped"
exit 1
fi

echo "Versions bumped correctly"

- name: Expose Package Metadata
id: package_metadata
run: |
VERSION=$(jq -r '.version' head/csmpackage.json)
PACKAGES_JSON=$(jq -c '.packages' head/csmpackage.json)

printf '%s\n' "version=$VERSION" >> $GITHUB_OUTPUT
printf '%s\n' "packages=$PACKAGES_JSON" >> $GITHUB_OUTPUT

generate_release_docs:
name: Generate Release Documentation (Release-Notes & Changelog)
needs: compare-versions
runs-on: ubuntu-latest
strategy:
matrix:
package: ${{ fromJson(needs.compare-versions.outputs.packages) }}
steps:
- name: CheckOut Head branch
uses: actions/checkout@v3
with:
ref: ${{ github.event.pull_request.head.ref }}
fetch-depth: 0
token: ${{ secrets.GITHUB_TOKEN }}

- name: SetUp GitHub Access
run: |
git config user.name "github-actions"
git config user.email "github-actions@github.com"

- name: Prepare Package Metadata
run: |
echo "PACKAGE='${{ matrix.package }}'"
echo "VERSION='${{ needs.compare-versions.outputs.version }}'"
shell: bash

- name: Generate release notes and update CHANGELOG
id: gen_docs
run: |
set -euo pipefail

PACKAGE="${{ matrix.package }}"
VERSION="${{ needs.compare-versions.outputs.version }}"

# Derive package path (preserve full path if matrix.package is a path)
PACKAGE_PATH="$PACKAGE"
# If matrix.package contains a repo-like "dir/subdir", keep it as-is.
# Release notes directory and file
RELEASE_DIR="$PACKAGE_PATH/release-notes"
RELEASE_FILE="$RELEASE_DIR/v${VERSION}.md"

echo "Package path: $PACKAGE_PATH"
echo "Release notes file: $RELEASE_FILE"

mkdir -p "$RELEASE_DIR"

# Build release notes content
{
echo "## Release $VERSION"
echo ""
echo "### Commits included"
echo ""
} > "$RELEASE_FILE"

BASE_SHA="${{ github.event.pull_request.base.sha }}"
HEAD_SHA="${{ github.event.pull_request.head.sha }}"

if [ -z "$BASE_SHA" ] || [ -z "$HEAD_SHA" ]; then
echo "- Unable to determine commit range." >> "$RELEASE_FILE"
else
# If there are no commits in range, note it; otherwise list commits
if [ "$(git rev-list --count "$BASE_SHA..$HEAD_SHA")" -eq 0 ]; then
echo "- No commits detected between base and head." >> "$RELEASE_FILE"
else
git --no-pager log --pretty=format:"- %s (%an)" "$BASE_SHA..$HEAD_SHA" >> "$RELEASE_FILE"
fi
fi

echo "Wrote release notes to $RELEASE_FILE"

# Ensure CHANGELOG exists at package root
CHANGELOG_FILE="$PACKAGE_PATH/CHANGELOG"
if [ ! -f "$CHANGELOG_FILE" ]; then
echo "Creating new CHANGELOG at $CHANGELOG_FILE"
echo "# Changelog" > "$CHANGELOG_FILE"
echo "" >> "$CHANGELOG_FILE"
fi

# Prepare new changelog entry content (you can customize the header/body format)
NEW_ENTRY_FILE="$(mktemp)"
{
echo "## v${VERSION}"
echo ""
echo "### Release notes"
echo ""
# Insert the same commit list into the changelog entry
sed -n '1,200000p' "$RELEASE_FILE" | sed '1,2d' # skip the top two lines already added above
echo ""
} > "$NEW_ENTRY_FILE"

# Replace existing entry for this version if present, otherwise prepend new entry after top header
# We treat entries as starting with a line that matches '^## v<version>'
if grep -qE "^## v${VERSION}\b" "$CHANGELOG_FILE"; then
echo "Found existing CHANGELOG entry for v${VERSION}, replacing it."
# Use awk to replace the section starting at "## vVERSION" up to the next "## v" or EOF
awk -v ver="v${VERSION}" -v newfile="$NEW_ENTRY_FILE" '
BEGIN {
replaced = 0;
while ((getline line < newfile) > 0) {
newlines = newlines line "\n"
}
close(newfile)
}
{
if ($0 ~ "^## " ver "\\b") {
# print newlines and skip until next "## v" or EOF
printf "%s", newlines
replaced = 1
# skip lines until next "## v" header
while (getline > 0) {
if ($0 ~ "^## v[0-9]+") {
print $0
break
}
}
next
}
print $0
}
END {
if (replaced == 0) {
# no replacement happened; print nothing here (caller will handle prepend)
}
}
' "$CHANGELOG_FILE" > "${CHANGELOG_FILE}.tmp" || true

# If awk produced a tmp file with content, move it back; otherwise fall back to prepend
if [ -s "${CHANGELOG_FILE}.tmp" ]; then
mv "${CHANGELOG_FILE}.tmp" "$CHANGELOG_FILE"
else
# fallback: prepend
cat "$NEW_ENTRY_FILE" "$CHANGELOG_FILE" > "${CHANGELOG_FILE}.tmp"
mv "${CHANGELOG_FILE}.tmp" "$CHANGELOG_FILE"
fi
else
echo "No existing entry for v${VERSION}. Prepending new entry to CHANGELOG."
# Prepend new entry after the top-level header if present, otherwise at top
# If file starts with "# Changelog", keep it and insert after that header
if head -n1 "$CHANGELOG_FILE" | grep -qE '^#\s+Changelog'; then
# keep header line, then insert new entry
tail -n +2 "$CHANGELOG_FILE" > "${CHANGELOG_FILE}.body.tmp"
{ head -n1 "$CHANGELOG_FILE"; echo ""; cat "$NEW_ENTRY_FILE"; echo ""; cat "${CHANGELOG_FILE}.body.tmp"; } > "${CHANGELOG_FILE}.tmp"
mv "${CHANGELOG_FILE}.tmp" "$CHANGELOG_FILE"
rm -f "${CHANGELOG_FILE}.body.tmp"
else
# no top header, just prepend
cat "$NEW_ENTRY_FILE" "$CHANGELOG_FILE" > "${CHANGELOG_FILE}.tmp"
mv "${CHANGELOG_FILE}.tmp" "$CHANGELOG_FILE"
fi
fi

rm -f "$NEW_ENTRY_FILE"

echo "Updated CHANGELOG at $CHANGELOG_FILE"

# Expose whether there are changes to commit
if git status --porcelain | grep -q .; then
echo "changes=true" >> "$GITHUB_OUTPUT"
else
echo "changes=false" >> "$GITHUB_OUTPUT"
fi
shell: bash

- name: Commit Generated vdocs
if: steps.gen_docs.outputs.changes == 'true'
run: |
set -euo pipefail
git add -A
# Use exact commit title requested
git commit -m "Generated vdocs."
git push origin HEAD:${{ github.event.pull_request.head.ref }}
echo "Pushed commit 'Generated vdocs.' to branch ${{ github.event.pull_request.head.ref }}"
shell: bash

- name: No changes to commit
if: steps.gen_docs.outputs.changes == 'false'
run: echo "No release docs changes detected; nothing to commit."


Loading
Loading