Skip to content
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

feat: Create Dialogporten Serviceowner client library #1513

Closed
wants to merge 144 commits into from

Conversation

Fargekritt
Copy link
Contributor

@Fargekritt Fargekritt commented Nov 22, 2024

Description

Related Issue(s)

Verification

  • Your code builds clean without any errors or warnings
  • Manual testing done (required)
  • Relevant automated test added (if you find this hard, leave it and we'll help out)

Documentation

  • Documentation is updated (either in docs-directory, Altinnpedia or a separate linked PR in altinn-studio-docs., if applicable)

Copy link
Contributor

coderabbitai bot commented Nov 22, 2024

Important

Review skipped

Draft detected.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Note

Reviews paused

Use the following commands to manage reviews:

  • @coderabbitai resume to resume automatic reviews.
  • @coderabbitai review to trigger a single review.
📝 Walkthrough

Walkthrough

This pull request updates several CI/CD GitHub workflows, enhancing job definitions with new publishing steps and refined secret handling. The solution and project files are revised to replace integration tests with unit tests and add new projects. Additionally, new sample application code, configuration files, and documentation for a Web API client have been added. Extra enhancements include a token verifier class, dependency injection extension methods, updated Swagger configurations, a new refitter configuration, and minor namespace changes in tests.

Changes

Files Change Summary
.github/workflows/ci-cd-main.yml, .github/workflows/ci-cd-pull-request.yml, .github/workflows/ci-cd-staging.yml, .github/workflows/workflow-publish-nuget.yml, .github/workflows/workflow-build-and-test.yml Workflows: Added new publish-sdk-to-nuget jobs, enhanced secrets (e.g., GCR_PASSWORD, Azure-related), reformatted needs arrays, added NuGet publishing workflow with inputs and environment set to test.
Digdir.Domain.Dialogporten.sln, src/.../WebApiClient.Sample.csproj, src/.../WebApiClient.csproj, src/.../WebApi.csproj Solution & Projects: Updated solution to replace integration with unit test projects and added new projects; project files now include new build targets (e.g., NSwag) and dependency references.
src/.../Dialogs.cs, src/.../Program.cs, src/.../appsettings.json Sample Application: Introduced sample project files including a new Dialogs class, command methods (CreateCommand, UpdateCommand), and a configuration file for Dialogporten API settings.
src/.../Config/DialogportenSettings.cs, src/.../Extensions/ServiceCollectionExtensions.cs, src/.../README.md Configuration & Extensions: Added configuration models and records for Dialogporten settings, new DI extension methods for client and token verifier registration, and updated SDK documentation.
src/.../Services/DialogTokenVerifier.cs, tests/.../SwaggerSnapshotTests.cs, tests/.../Utils.cs Token Verification & Tests: Introduced the DialogTokenVerifier class with verification and claim extraction methods; updated unit tests to remove web factory dependencies and adjusted namespaces from integration to unit.
src/.../Program.cs, docs/.../swagger.verified.json API & Swagger: Revised Swagger document processing in Program.cs and updated the server URL in the OpenAPI specification from a cloud to a local endpoint.
src/.../.refitter, src/.../AssemblyMarker.cs Other New Files: Added a new Refitter configuration file for generating API client code and an assembly marker class for referencing the assembly.

Suggested reviewers

  • MagnusSandgren
  • arealmaas

Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?

❤️ Share
🪧 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.
    • Generate unit testing code for this file.
    • 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 generate unit testing code for this file.
    • @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 generate unit testing code.
    • @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.

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. (Beta)
  • @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.

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.

@Fargekritt Fargekritt force-pushed the feat/add-WepApiClient-project branch from b859eb3 to d33461f Compare November 25, 2024 07:25
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

🔭 Outside diff range comments (1)
docs/schema/V1/swagger.verified.json (1)

1-7070: API Specification Completeness Issues

After reviewing the repository results and the swagger.verified.json, we found that:

  • CORS Configuration: No explicit API-level CORS configuration is documented in the OpenAPI spec. The only CORS-like configuration appeared in a non-API file (local-otel-configuration/otel-collector-config.yaml), which is unrelated to the API endpoints.
  • Rate Limiting: Searches revealed no files or code indicative of rate limiting configurations (e.g. via RateLimit, ThrottleAttribute, or IpRateLimiting), and the spec itself does not document any rate limiting headers.
  • Pagination Headers Documentation: While the codebase includes pagination logic (PaginatedList and related classes), the OpenAPI spec lacks dedicated documentation on pagination headers (such as those for continuation tokens or related metadata).
  • API Status Endpoint: There is no documented API status endpoint in the specification.

Based on this evidence, the API specification appears to be missing these common elements.

🔗 Analysis chain

Verify API specification completeness.

The specification appears to be missing some common OpenAPI elements:

  1. CORS configuration
  2. Rate limiting headers
  3. Pagination headers documentation
  4. API status endpoint

Let's check for these elements in the codebase:

🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Search for CORS configuration
echo "Searching for CORS configuration..."
rg -l "cors|UseCors|AddCors"

# Search for rate limiting configuration
echo "Searching for rate limiting configuration..."
rg -l "RateLimit|ThrottleAttribute|IpRateLimiting"

# Search for pagination implementation
echo "Searching for pagination implementation..."
rg -l "PaginatedList|IPagedList|PagedResult"

Length of output: 1684

♻️ Duplicate comments (2)
.github/workflows/ci-cd-staging.yml (1)

86-94: ⚠️ Potential issue

Secret Name Mismatch in "publish-sdk-to-nuget" Job:
The job is provisioned with NUGET_API_TEST_KEY while the reusable workflow expects NUGET_API_KEY. Please update the secret name to ensure the correct key is passed.

-      NUGET_API_KEY: ${{ secrets.NUGET_API_TEST_KEY }}
+      NUGET_API_KEY: ${{ secrets.NUGET_API_KEY }}
.github/workflows/ci-cd-main.yml (1)

107-115: ⚠️ Potential issue

Secret Name Mismatch in "publish-sdk-to-nuget" Job:
As in the staging workflow, the job here is using NUGET_API_TEST_KEY while the called reusable workflow expects NUGET_API_KEY. Please update the secret reference accordingly.

-      NUGET_API_KEY: ${{ secrets.NUGET_API_TEST_KEY }}
+      NUGET_API_KEY: ${{ secrets.NUGET_API_KEY }}
🧹 Nitpick comments (8)
.github/workflows/ci-cd-staging.yml (2)

92-92: Improve Project File Path Resolution:
Using an inline shell command in the path parameter (i.e. $(find . -name '*Digdir.Library.Dialogporten.WebApiClient.csproj' -printf "%p" -quit)) may lead to cross-platform or maintenance issues. Consider setting the project file path in a dedicated step (or using a predefined static path) for better robustness.


95-95: Remove Trailing Whitespace:
Trailing spaces have been detected on this line. Please remove them to conform with YAML linting practices.

🧰 Tools
🪛 YAMLlint (1.35.1)

[error] 95-95: trailing spaces

(trailing-spaces)

.github/workflows/ci-cd-main.yml (2)

113-113: Improve Project File Path Resolution:
The inline shell command used in the path parameter can be fragile on non-Unix runners. Consider moving this resolution to a dedicated step or using a fixed/predefined path for better compatibility and maintainability.


116-116: Remove Trailing Whitespace:
Trailing spaces have been detected on this line. Removing them will help ensure compliance with YAML formatting standards.

🧰 Tools
🪛 YAMLlint (1.35.1)

[error] 116-116: trailing spaces

(trailing-spaces)

docs/schema/V1/swagger.verified.json (4)

4736-4739: Enhance API metadata for better documentation.

The API metadata is minimal. Consider adding:

  • A detailed description of the API's purpose and functionality
  • Contact information for API support
  • Terms of service URL
  • License information
  • External documentation links

Apply this diff to enhance the API metadata:

  "info": {
    "title": "Dialogporten",
-   "version": "v1"
+   "version": "v1",
+   "description": "Dialogporten API provides a standardized way to manage and track dialogs between service owners and end users in Altinn.",
+   "contact": {
+     "name": "Dialogporten Support",
+     "url": "https://www.altinn.no/dialogporten/support",
+     "email": "[email protected]"
+   },
+   "termsOfService": "https://www.altinn.no/dialogporten/terms",
+   "license": {
+     "name": "MIT",
+     "url": "https://opensource.org/licenses/MIT"
+   }
  }

4727-4734: Improve security scheme documentation.

The JWT Bearer authentication scheme description is generic. Consider enhancing it with:

  • Required scopes for different operations
  • Token format requirements
  • Token acquisition process

Apply this diff to improve the security scheme documentation:

  "securitySchemes": {
    "JWTBearerAuth": {
      "bearerFormat": "JWT",
-     "description": "Enter a JWT token to authorize the requests...",
+     "description": "Use a Maskinporten-issued JWT token to authorize requests. Required scopes:\n- digdir:dialogporten: For end-user operations\n- digdir:dialogporten.serviceprovider: For service owner operations\n- digdir:dialogporten.serviceprovider.search: For service owner search operations\n- altinn:system/notifications.condition.check: For notification condition checks\n\nToken must be obtained from Maskinporten using valid credentials. See https://samarbeid.digdir.no/maskinporten/maskinporten/25 for details.",
      "scheme": "bearer",
      "type": "http"
    }
  }

2-3: Consider adding API versioning information in components.

The OpenAPI specification uses components without version prefixes, which could make future API versioning more challenging.

Consider prefixing component schemas with version information to better support API versioning:

  "components": {
    "schemas": {
-     "Actors_ActorType": {
+     "V1_Actors_ActorType": {
        // ... schema definition ...
      },
      // ... other schemas ...
    }
  }

4742-7064: Enhance API paths organization and documentation.

The API paths section could benefit from:

  1. Grouping related endpoints using tags
  2. Consistent response codes across similar operations
  3. More detailed operation descriptions
  4. Request/response examples

Consider adding operation examples and enhancing descriptions. For example:

  "/api/v1/serviceowner/dialogs": {
    "post": {
      "description": "The dialog is created with the given configuration. For more information see the documentation (link TBD).",
+     "x-code-samples": [
+       {
+         "lang": "curl",
+         "source": "curl -X POST 'https://api.dialogporten.no/api/v1/serviceowner/dialogs' \\\n  -H 'Authorization: Bearer <token>' \\\n  -H 'Content-Type: application/json' \\\n  -d '{\"dto\":{\"content\":{\"title\":\"Test Dialog\"},\"party\":\"urn:altinn:organization:identifier-no:123456789\"}}'"
+       }
+     ],
      // ... rest of the operation definition ...
    }
  }
📜 Review details

Configuration used: .coderabbit.yaml
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 748f2bd and d5096b9.

📒 Files selected for processing (5)
  • .github/workflows/ci-cd-main.yml (2 hunks)
  • .github/workflows/ci-cd-staging.yml (1 hunks)
  • docs/schema/V1/swagger.verified.json (1 hunks)
  • src/Digdir.Domain.Dialogporten.WebApi/Digdir.Domain.Dialogporten.WebApi.csproj (2 hunks)
  • src/Digdir.Library.Dialogporten.WebApiClient/Digdir.Library.Dialogporten.WebApiClient.csproj (1 hunks)
🚧 Files skipped from review as they are similar to previous changes (2)
  • src/Digdir.Library.Dialogporten.WebApiClient/Digdir.Library.Dialogporten.WebApiClient.csproj
  • src/Digdir.Domain.Dialogporten.WebApi/Digdir.Domain.Dialogporten.WebApi.csproj
🧰 Additional context used
🪛 YAMLlint (1.35.1)
.github/workflows/ci-cd-main.yml

[error] 116-116: trailing spaces

(trailing-spaces)

.github/workflows/ci-cd-staging.yml

[error] 95-95: trailing spaces

(trailing-spaces)

🔇 Additional comments (2)
.github/workflows/ci-cd-main.yml (1)

35-40: Verify New Secrets in "build-and-test" Job:
New secrets related to DIALOGPORTEN_MASKINPORTEN and ED25519KEYS have been added. Please double-check that these values are correctly configured in the CI/CD environment and remain securely managed.

docs/schema/V1/swagger.verified.json (1)

4740-4741: Verify OpenAPI version compatibility.

The specification uses OpenAPI 3.0.0, which is an older version. Consider upgrading to OpenAPI 3.1.0 for access to newer features and improvements.

Let's check for any dependencies that might be affected by an OpenAPI version upgrade:

Copy link
Collaborator

@MagnusSandgren MagnusSandgren left a comment

Choose a reason for hiding this comment

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

Mye bra her! Skal vi ta en huddle og få dette gjennom? 🙂

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: 3

♻️ Duplicate comments (4)
src/Digdir.Library.Dialogporten.WebApiClient/Config/DialogportenSettings.cs (3)

5-9: ⚠️ Potential issue

Add missing Environment property and proper initialization.

The class is missing the Environment property that's used in ServiceCollectionExtensions.cs. Also, the use of null-forgiving operators without validation could lead to runtime errors.

Apply this diff to add proper initialization and validation:

 public class DialogportenSettings
 {
-    public string BaseUri { get; set; } = null!;
-    public MaskinportenSettings Maskinporten { get; set; } = null!;
+    public string Environment { get; }
+    public string BaseUri { get; }
+    public MaskinportenSettings Maskinporten { get; }
+
+    public DialogportenSettings()
+    {
+        // Parameterless constructor for configuration binding
+    }
+
+    public DialogportenSettings(string environment, string baseUri, MaskinportenSettings maskinporten)
+    {
+        Environment = environment ?? throw new ArgumentNullException(nameof(environment));
+        BaseUri = baseUri ?? throw new ArgumentNullException(nameof(baseUri));
+        Maskinporten = maskinporten ?? throw new ArgumentNullException(nameof(maskinporten));
+    }
 }

11-15: ⚠️ Potential issue

Initialize Ed25519Keys with required values.

The use of null-forgiving operators without validation could lead to runtime errors.

Apply this diff to add proper initialization and validation:

 public record Ed25519Keys
 {
-    public Ed25519Key Primary { get; set; } = null!;
-    public Ed25519Key Secondary { get; set; } = null!;
+    public Ed25519Key Primary { get; }
+    public Ed25519Key Secondary { get; }
+
+    public Ed25519Keys()
+    {
+        // Parameterless constructor for configuration binding
+    }
+
+    public Ed25519Keys(Ed25519Key primary, Ed25519Key secondary)
+    {
+        Primary = primary ?? throw new ArgumentNullException(nameof(primary));
+        Secondary = secondary ?? throw new ArgumentNullException(nameof(secondary));
+    }
 }

17-21: ⚠️ Potential issue

Add validation for Ed25519Key properties.

The use of null-forgiving operators without validation could lead to runtime errors.

Apply this diff to add proper initialization and validation:

 public record Ed25519Key
 {
-    public string Kid { get; set; } = null!;
-    public string PublicComponent { get; set; } = null!;
+    public string Kid { get; }
+    public string PublicComponent { get; }
+
+    public Ed25519Key()
+    {
+        // Parameterless constructor for configuration binding
+    }
+
+    public Ed25519Key(string kid, string publicComponent)
+    {
+        Kid = !string.IsNullOrEmpty(kid) ? kid : throw new ArgumentException("Kid cannot be null or empty", nameof(kid));
+        PublicComponent = !string.IsNullOrEmpty(publicComponent) ? publicComponent : throw new ArgumentException("PublicComponent cannot be null or empty", nameof(publicComponent));
+    }
 }
src/Digdir.Library.Dialogporten.WebApiClient/Extensions/ServiceCollectionExtensions.cs (1)

19-32: ⚠️ Potential issue

Avoid building service provider within service registration methods.

Building service provider within registration methods can lead to memory leaks and duplicate singleton instances.

Apply this diff to fix the issues:

-public static IServiceCollection AddDialogTokenVerifer(this IServiceCollection services)
+public static IServiceCollection AddDialogTokenVerifer(this IServiceCollection services, IConfiguration configuration)
 {
-    var provider = services.BuildServiceProvider();
-    var dialogportenSettings = provider.GetRequiredService<IConfiguration>()
+    var dialogportenSettings = configuration
         .GetSection("Ed25519Keys")
-        .Get<Ed25519Keys>();
+        .Get<Ed25519Keys>() ?? throw new InvalidOperationException("Ed25519Keys configuration is missing");

     var keyPair = dialogportenSettings!.Primary;
     var kid = keyPair.Kid;
     var publicKey = PublicKey.Import(SignatureAlgorithm.Ed25519,
         Base64Url.DecodeFromChars(keyPair.PublicComponent), KeyBlobFormat.RawPublicKey);
     services.AddSingleton(new DialogTokenVerifier(kid, publicKey));
     return services;
 }
🧹 Nitpick comments (4)
.github/workflows/workflow-publish-nuget.yml (1)

42-44: Improve NuGet push command formatting and remove trailing whitespace.
Please update the NuGet push command by explicitly quoting the file path and API key, and remove any unintended trailing whitespace. For example, you can apply the following diff:

-      - name: Push to NuGet   
-        run: dotnet nuget push *.nupkg --source "${{ inputs.source }}" --api-key ${{secrets.NUGET_API_KEY}}
+      - name: Push to NuGet
+        run: dotnet nuget push "./*.nupkg" --source "${{ inputs.source }}" --api-key "${{ secrets.NUGET_API_KEY }}"
🧰 Tools
🪛 YAMLlint (1.35.1)

[error] 42-42: trailing spaces

(trailing-spaces)


[error] 43-43: trailing spaces

(trailing-spaces)

.github/workflows/ci-cd-pull-request.yml (2)

21-21: Remove unnecessary trailing whitespace.
There is extraneous trailing whitespace on this line; please remove it to ensure a clean YAML file.

🧰 Tools
🪛 YAMLlint (1.35.1)

[error] 21-21: trailing spaces

(trailing-spaces)


37-37: Clean up trailing whitespace.
Please remove the extra trailing space on this line to improve file consistency.

🧰 Tools
🪛 YAMLlint (1.35.1)

[error] 37-37: trailing spaces

(trailing-spaces)

src/Digdir.Library.Dialogporten.WebApiClient/AssemblyMarker.cs (1)

5-9: Fix formatting issues.

Remove extra blank line between the class declaration and the field.

Apply this diff to fix formatting:

 internal sealed class AssemblyMarker
 {
-    
     public static readonly Assembly Assembly = typeof(AssemblyMarker).Assembly;
 }
🧰 Tools
🪛 GitHub Check: build / build-and-test

[failure] 7-7:
Fix formatting (https://learn.microsoft.com/dotnet/fundamentals/code-analysis/style-rules/ide0055)


[failure] 7-7:
Fix formatting (https://learn.microsoft.com/dotnet/fundamentals/code-analysis/style-rules/ide0055)

📜 Review details

Configuration used: .coderabbit.yaml
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between d5096b9 and 4f9928b.

📒 Files selected for processing (11)
  • .github/workflows/ci-cd-main.yml (1 hunks)
  • .github/workflows/ci-cd-pull-request.yml (3 hunks)
  • .github/workflows/ci-cd-staging.yml (1 hunks)
  • .github/workflows/workflow-build-and-test.yml (1 hunks)
  • .github/workflows/workflow-publish-nuget.yml (1 hunks)
  • src/Digdir.Domain.Dialogporten.WebApi/Digdir.Domain.Dialogporten.WebApi.csproj (2 hunks)
  • src/Digdir.Library.Dialogporten.WebApiClient.Sample/Digdir.Library.Dialogporten.WebApiClient.Sample.csproj (1 hunks)
  • src/Digdir.Library.Dialogporten.WebApiClient/AssemblyMarker.cs (1 hunks)
  • src/Digdir.Library.Dialogporten.WebApiClient/Config/DialogportenSettings.cs (1 hunks)
  • src/Digdir.Library.Dialogporten.WebApiClient/Digdir.Library.Dialogporten.WebApiClient.csproj (1 hunks)
  • src/Digdir.Library.Dialogporten.WebApiClient/Extensions/ServiceCollectionExtensions.cs (1 hunks)
🚧 Files skipped from review as they are similar to previous changes (4)
  • .github/workflows/workflow-build-and-test.yml
  • src/Digdir.Library.Dialogporten.WebApiClient.Sample/Digdir.Library.Dialogporten.WebApiClient.Sample.csproj
  • src/Digdir.Library.Dialogporten.WebApiClient/Digdir.Library.Dialogporten.WebApiClient.csproj
  • src/Digdir.Domain.Dialogporten.WebApi/Digdir.Domain.Dialogporten.WebApi.csproj
🧰 Additional context used
🪛 YAMLlint (1.35.1)
.github/workflows/workflow-publish-nuget.yml

[error] 42-42: trailing spaces

(trailing-spaces)


[error] 43-43: trailing spaces

(trailing-spaces)

.github/workflows/ci-cd-main.yml

[error] 110-110: trailing spaces

(trailing-spaces)

.github/workflows/ci-cd-staging.yml

[error] 96-96: trailing spaces

(trailing-spaces)

.github/workflows/ci-cd-pull-request.yml

[error] 21-21: trailing spaces

(trailing-spaces)


[error] 37-37: trailing spaces

(trailing-spaces)

🪛 actionlint (1.7.4)
.github/workflows/ci-cd-main.yml

102-102: input "source" is required by "./.github/workflows/workflow-publish-nuget.yml" reusable workflow

(workflow-call)

🪛 GitHub Check: build / build-and-test
src/Digdir.Library.Dialogporten.WebApiClient/Extensions/ServiceCollectionExtensions.cs

[failure] 44-44:
'DialogportenSettings' does not contain a definition for 'Environment' and no accessible extension method 'Environment' accepting a first argument of type 'DialogportenSettings' could be found (are you missing a using directive or an assembly reference?)


[failure] 56-56:
'DialogportenSettings' does not contain a definition for 'Environment' and no accessible extension method 'Environment' accepting a first argument of type 'DialogportenSettings' could be found (are you missing a using directive or an assembly reference?)


[failure] 91-91:
Fix formatting (https://learn.microsoft.com/dotnet/fundamentals/code-analysis/style-rules/ide0055)


[failure] 99-99:
Fix formatting (https://learn.microsoft.com/dotnet/fundamentals/code-analysis/style-rules/ide0055)


[failure] 44-44:
'DialogportenSettings' does not contain a definition for 'Environment' and no accessible extension method 'Environment' accepting a first argument of type 'DialogportenSettings' could be found (are you missing a using directive or an assembly reference?)


[failure] 56-56:
'DialogportenSettings' does not contain a definition for 'Environment' and no accessible extension method 'Environment' accepting a first argument of type 'DialogportenSettings' could be found (are you missing a using directive or an assembly reference?)


[failure] 91-91:
Fix formatting (https://learn.microsoft.com/dotnet/fundamentals/code-analysis/style-rules/ide0055)


[failure] 99-99:
Fix formatting (https://learn.microsoft.com/dotnet/fundamentals/code-analysis/style-rules/ide0055)

src/Digdir.Library.Dialogporten.WebApiClient/AssemblyMarker.cs

[failure] 7-7:
Fix formatting (https://learn.microsoft.com/dotnet/fundamentals/code-analysis/style-rules/ide0055)


[failure] 7-7:
Fix formatting (https://learn.microsoft.com/dotnet/fundamentals/code-analysis/style-rules/ide0055)

⏰ Context from checks skipped due to timeout of 90000ms (1)
  • GitHub Check: Dry run deploy infrastructure / Deploy to test
🔇 Additional comments (3)
.github/workflows/ci-cd-staging.yml (1)

94-95: ⚠️ Potential issue

Fix secret name mismatch in the NuGet publishing job.
The reusable workflow expects the secret NUGET_API_KEY, but it’s currently mapped to ${{ secrets.NUGET_API_TEST_KEY }}. Please update it as follows:

-      NUGET_API_KEY: ${{ secrets.NUGET_API_TEST_KEY }}
+      NUGET_API_KEY: ${{ secrets.NUGET_API_KEY }}

Likely invalid or redundant comment.

.github/workflows/ci-cd-main.yml (2)

107-107: 🛠️ Refactor suggestion

⚠️ Potential issue

Replace shell command with an explicit project path.
Using a shell command to dynamically resolve the project file path may lead to inconsistencies across different runner environments. Please replace it with the explicit file path. For instance:

-      path: $(find . -name '*Digdir.Library.Dialogporten.WebApiClient.csproj' -printf "%p"  -quit)
+      path: 'src/Digdir.Library.Dialogporten.WebApiClient/Digdir.Library.Dialogporten.WebApiClient.csproj'

Likely invalid or redundant comment.


109-110: ⚠️ Potential issue

Correct the NuGet API key secret mapping.
The job currently maps NUGET_API_KEY to ${{ secrets.NUGET_API_TEST_KEY }}, which could cause issues if the test key differs from the intended production key. Please update it as shown below:

-      NUGET_API_KEY: ${{ secrets.NUGET_API_TEST_KEY }}
+      NUGET_API_KEY: ${{ secrets.NUGET_API_KEY }}

Likely invalid or redundant comment.

🧰 Tools
🪛 YAMLlint (1.35.1)

[error] 110-110: trailing spaces

(trailing-spaces)

@oskogstad
Copy link
Collaborator

@coderabbitai pause

Copy link
Contributor

coderabbitai bot commented Feb 4, 2025

✅ Actions performed

Reviews paused.

@Fargekritt Fargekritt requested a review from a team as a code owner February 6, 2025 12:55
Copy link
Collaborator

@MagnusSandgren MagnusSandgren left a comment

Choose a reason for hiding this comment

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

  • En ny release candidate blir pusha til nuget ved hver skjemaendring i dev
  • Skal vi hente public token fra DP well know, eller skal brukere få konfigurere det?

@Fargekritt Fargekritt marked this pull request as draft February 11, 2025 08:19
@Fargekritt Fargekritt closed this Feb 11, 2025
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.

4 participants