Skip to content

Conversation

DaveSkender
Copy link
Owner

@DaveSkender DaveSkender commented Dec 30, 2024

Problem: preview version not incrementing (suffix not considered)

Goal: Prerelease “preview” tag from gitversion.yml is recognized by GitVersion

Ref: GitVersion configuration and variables docs

Important

Don't merge here, this is just for troubleshooting v3 preview version numbering generation, without doing any actual deployments. After dry runs are working here, @DaveSkender will manually move code to final in PR #1346

NO PACKAGE DEPLOYMENT DONE HERE WHILE TESTING

Ref: GitVersion configuration and variables docs

To do

  • try again with built-in tasks. the error was I was using -c instead of -config for path
  • conditionally use prerelease gitversion variable
  • Temporarily disable publish/deploy steps for safety, add temp on push trigger to troubleshoot more simply (does not deploy to package managers)
  • fix: load GitVersion vars to env
  • review behavior of workflow: GitHubFlow/v1 vs TrunkBased/preview1 or others
  • ensure NO_ENVIRONMENT is not created, or use “”

Acceptance criteria

Version numbers generate correctly for dry runs as:

  • 3.0.0-preview.2 for production preview (pre-release)
  • 3.0.0 for production dry runs
  • 3.0.0-preview.2-{pr-id}-{run-attempt} for CI builds (because we have next-version: 3.0.0 in branch gitversion.yml

Given these published versions as a reference:

image

Summary by CodeRabbit

  • Chores

    • Added the GitHub Copilot Chat extension to the development container setup.
    • Updated the .gitignore file to exclude local dotnet tool manifest configuration for GitVersion.
  • Refactor

    • Restructured deployment workflow for clearer separation of validation, packaging, and deployment steps.
    • Enhanced version handling and environment-aware deployment logic in the workflow.
  • New Features

    • Expanded and detailed GitVersion configuration to support multiple branch types and improved version labeling.

@DaveSkender DaveSkender self-assigned this Dec 30, 2024
@DaveSkender DaveSkender changed the title Fix deployer ci: Fix versioning in package deployment (v3) Dec 30, 2024
Copy link
Contributor

@Copilot 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.

Copilot reviewed 3 out of 4 changed files in this pull request and generated no comments.

Files not reviewed (1)
  • .vscode/settings.json: Language not supported

@DaveSkender
Copy link
Owner Author

DaveSkender commented Dec 30, 2024

Steps to add locally:

  1. Install tool from repo folder (can also install globally)
    dotnet new tool-manifest
    dotnet tool install GitVersion.Tool --version 6.0.5
  2. Show configuration
    # both of these work
    dotnet-gitversion -c src/gitversion.yml -showconfig
    dotnet gitversion -c src/gitversion.yml -showconfig
  3. Run diagnostics
    dotnet gitversion -diag -config src/gitversion.yml

Signed-off-by: Dave Skender <8432125+DaveSkender@users.noreply.github.com>
Signed-off-by: Dave Skender <8432125+DaveSkender@users.noreply.github.com>
Signed-off-by: Dave Skender <8432125+DaveSkender@users.noreply.github.com>
Signed-off-by: Dave Skender <8432125+DaveSkender@users.noreply.github.com>
Signed-off-by: Dave Skender <8432125+DaveSkender@users.noreply.github.com>
Signed-off-by: Dave Skender <8432125+DaveSkender@users.noreply.github.com>
Signed-off-by: Dave Skender <8432125+DaveSkender@users.noreply.github.com>
Signed-off-by: Dave Skender <8432125+DaveSkender@users.noreply.github.com>
@DaveSkender DaveSkender mentioned this pull request Jun 4, 2025
3 tasks
- Remove 'NO_ENVIRONMENT' fallback to avoid invalid environment creation
- Update GitVersion config to use proper tag/label configuration
- Remove duplicate .NET setup steps
- Export GitVersion variables to environment for proper version composition
- Update GitVersion tool to latest version
- Simplify workflow outputs and summaries
- Fix environment condition for deploy job
…ag' property

- GitVersion 6.x replaced 'tag' with 'label' property
- This fixes the configuration parsing error in the workflow
- Now generates correct version: 3.0.0-preview.2
@DaveSkender DaveSkender marked this pull request as ready for review July 18, 2025 05:37
Copy link
Contributor

coderabbitai bot commented Jul 18, 2025

Warning

Rate limit exceeded

@DaveSkender has exceeded the limit for the number of commits or files that can be reviewed per hour. Please wait 5 minutes and 19 seconds before requesting another review.

⌛ How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout.

Please see our FAQ for further information.

📥 Commits

Reviewing files that changed from the base of the PR and between 413aff4 and 05d3a3a.

📒 Files selected for processing (2)
  • .github/workflows/deploy-package.yml (6 hunks)
  • .gitignore (1 hunks)

Walkthrough

The updates introduce enhanced GitVersion configuration, restructure the deployment workflow by separating validation and packaging into distinct jobs, add the GitHub Copilot Chat extension to the devcontainer, and update .gitignore to exclude local dotnet tool manifests. The changes focus on improved versioning, environment handling, and developer tooling configuration.

Changes

File(s) Change Summary
.github/workflows/deploy-package.yml Refactored workflow: split validation and packaging into separate jobs, improved version/environment handling, updated job dependencies, outputs, and triggers.
src/gitversion.yml Expanded and detailed branch configuration for GitVersion, added global label, and introduced empty ignore/merge-message sections.
.devcontainer/devcontainer.json Added "GitHub.copilot-chat" extension to the VS Code devcontainer configuration.
.gitignore Added rules to ignore .config files for suppressing local dotnet tool manifests, specifically for GitVersion.

Sequence Diagram(s)

sequenceDiagram
    participant Developer
    participant GitHub Actions
    participant GitVersion
    participant NuGet

    Developer->>GitHub Actions: Push/dispatch workflow
    GitHub Actions->>GitVersion: Validate configuration (validate job)
    GitHub Actions->>GitVersion: Generate version info (package job)
    GitHub Actions->>NuGet: Publish package (deploy job, if not dry-run)
    GitHub Actions-->>Developer: Outputs summary and release notes
Loading

Poem

In the garden of code, a new branch grows,
With Copilot’s chat, where wisdom flows.
Versioning’s clear, the workflow’s neat,
GitVersion hops with nimble feet.
Ignore the clutter, let releases bloom,
This rabbit’s proud—there’s plenty of room! 🐇✨


🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Explain this complex logic.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai explain this code block.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and explain its main purpose.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Support

Need help? Create a ticket on our support page for assistance with any issues or questions.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR.
  • @coderabbitai generate sequence diagram to generate a sequence diagram of the changes in this PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 5

🧹 Nitpick comments (4)
.devcontainer/devcontainer.json (1)

45-47: Pin extension versions for reproducible dev-containers.
Leaving extensions unpinned means every rebuild can silently pull a newer (and potentially incompatible) release. To keep builds deterministic, consider specifying explicit versions:

 "extensions": [
   "ms-dotnettools.csdevkit",
-  "DavidAnson.vscode-markdownlint",
-  "GitHub.copilot-chat"
+  "DavidAnson.vscode-markdownlint@0.51.0",
+  "GitHub.copilot-chat@0.14.0"
 ]

(Hard-code whatever current versions you validate with.)

src/gitversion.yml (2)

13-18: Main branch rule: consider explicit increment: None

Currently main increments Patch, which will tick the patch number on every commit even for documentation-only changes.
If semantic bumping is already controlled via commit messages (+semver: tags configured above), you can set:

main:
  increment: None

and let the commit messages (or release branches) drive version bumps, eliminating noisy patch revs.


31-38: Missing source-branches for pull-request / unknown sections may break inheritance

GitVersion 6 infers source-branches but emits warnings when they are absent. Add explicit lists if you want clean diagnostics:

pull-request:
  increment: Inherit
  source-branches: [feature, main, release]
  label: preview

Same for unknown.

.github/workflows/deploy-package.yml (1)

118-122: Tool installation duplicated – cache the global install

dotnet tool install --global GitVersion.Tool is executed in both validate and package jobs. Installing once in the shared setup action (or caching with actions/cache) will shave ≈4–5 s per job.

📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 8272fca and bdde4c8.

📒 Files selected for processing (4)
  • .devcontainer/devcontainer.json (1 hunks)
  • .github/workflows/deploy-package.yml (6 hunks)
  • .gitignore (1 hunks)
  • src/gitversion.yml (2 hunks)
🧰 Additional context used
🧠 Learnings (1)
.gitignore (1)
Learnt from: CR
PR: DaveSkender/Stock.Indicators#0
File: .github/copilot-instructions.md:0-0
Timestamp: 2025-07-17T05:41:55.020Z
Learning: Applies to src/**/*.cs : Consistent formatting using `.editorconfig`
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
  • GitHub Check: Codacy Static Code Analysis
🔇 Additional comments (2)
.devcontainer/devcontainer.json (1)

46-46: Addition of Copilot Chat improves DX – looks good.
The new GitHub.copilot-chat extension completes the existing chat-related settings and should make AI-assisted development inside the container smoother. No concerns.

src/gitversion.yml (1)

39-39: Root-level label: preview already applies to unknown – duplication not harmful but redundant

Because unknown explicitly sets label: preview, keeping the global label is optional.

DaveSkender and others added 2 commits July 18, 2025 01:52
Signed-off-by: Dave Skender <8432125+DaveSkender@users.noreply.github.com>
Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
Signed-off-by: Dave Skender <8432125+DaveSkender@users.noreply.github.com>
Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

♻️ Duplicate comments (5)
.github/workflows/deploy-package.yml (5)

64-66: dotnet gitversion will not be found with a global tool install
Global installation exposes gitversion or dotnet-gitversion, not dotnet gitversion.
Use one of the exposed executables to avoid a “No executable found matching command” failure.


67-69: -updateassemblyinfo pollutes the working tree
The flag rewrites AssemblyInfo and leaves the repo dirty – unnecessary for CI.
Simply emit JSON (dotnet-gitversion …) and export variables.


138-144: Preview number is duplicated in the composed version string
PreReleaseTag already contains the numeric component (preview.2).
Appending .${{ env.PreReleaseNumber }} yields preview.2.2.
Use only PreReleaseTag or just rely on FullSemVer.


237-238: Conditional never becomes true; publish step is always skipped
env.dry_run is a string. !env.dry_run coerces any non-empty string to true, then negates to false.
Compare explicitly instead:

-if: ${{ !env.dry_run }}
+if: ${{ env.dry_run != 'true' }}

245-247: Same logic bug for release-note gating
The condition has the identical !env.dry_run issue; the step will never run.
Apply the explicit string comparison here as well.

📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between bdde4c8 and 413aff4.

📒 Files selected for processing (1)
  • .github/workflows/deploy-package.yml (6 hunks)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (3)
  • GitHub Check: unit tests (windows-latest, 9.0.x)
  • GitHub Check: unit tests (windows-latest, 6.0.x)
  • GitHub Check: Analyze (csharp)

DaveSkender and others added 4 commits July 18, 2025 01:58
Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
Signed-off-by: Dave Skender <8432125+DaveSkender@users.noreply.github.com>
Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
Signed-off-by: Dave Skender <8432125+DaveSkender@users.noreply.github.com>
Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
Signed-off-by: Dave Skender <8432125+DaveSkender@users.noreply.github.com>
Signed-off-by: Dave Skender <8432125+DaveSkender@users.noreply.github.com>
@DaveSkender DaveSkender merged commit fe3770e into v3 Jul 18, 2025
16 checks passed
@DaveSkender DaveSkender deleted the fix-deployer branch July 18, 2025 06:14
@github-project-automation github-project-automation bot moved this from In Progress to Done in Stock Indicators for .NET Jul 18, 2025
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Aug 24, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

1 participant