Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
86 changes: 56 additions & 30 deletions .github/workflows/Master-CodeQL.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,70 +7,96 @@
# ******** NOTE ********
# We have attempted to detect the languages in your repository. Please check
# the `language` matrix defined below to confirm you have the correct set of
# supported CodeQL languages.
# supported CodeQL languages.
#
name: "master-codeql"

on:
push:
pull_request:
types: [opened, reopened, edited, synchronize]
branches: [ "master" ]
paths-ignore:
- "**/*.md"
- "**/*.gitignore"
- "**/*.gitattributes"
- "**/*.gitattributes"
schedule:
- cron: '35 15 * * 2'
- cron: '42 7 * * 5'

jobs:
analyze:
name: Analyze
runs-on: ubuntu-latest
name: Analyze (${{ matrix.language }})
# Runner size impacts CodeQL analysis time. To learn more, please see:
# - https://gh.io/recommended-hardware-resources-for-running-codeql
# - https://gh.io/supported-runners-and-hardware-resources
# - https://gh.io/using-larger-runners (GitHub.com only)
# Consider using larger runners or machines with greater resources for possible analysis time improvements.
runs-on: ${{ (matrix.language == 'swift' && 'macos-latest') || 'ubuntu-latest' }}
permissions:
# required for all workflows
security-events: write

# required to fetch internal or private CodeQL packs
packages: read

# only required for workflows in private repositories
actions: read
contents: read
security-events: write

strategy:
fail-fast: false
matrix:
language: [ 'csharp' ]
# CodeQL supports [ 'cpp', 'csharp', 'go', 'java', 'javascript', 'python', 'ruby' ]
# Learn more about CodeQL language support at https://aka.ms/codeql-docs/language-support

include:
- language: actions
build-mode: none
- language: csharp
build-mode: none
# CodeQL supports the following values keywords for 'language': 'actions', 'c-cpp', 'csharp', 'go', 'java-kotlin', 'javascript-typescript', 'python', 'ruby', 'swift'
# Use `c-cpp` to analyze code written in C, C++ or both
# Use 'java-kotlin' to analyze code written in Java, Kotlin or both
# Use 'javascript-typescript' to analyze code written in JavaScript, TypeScript or both
# To learn more about changing the languages that are analyzed or customizing the build mode for your analysis,
# see https://docs.github.com/en/code-security/code-scanning/creating-an-advanced-setup-for-code-scanning/customizing-your-advanced-setup-for-code-scanning.
# If you are analyzing a compiled language, you can modify the 'build-mode' for that language to customize how
# your codebase is analyzed, see https://docs.github.com/en/code-security/code-scanning/creating-an-advanced-setup-for-code-scanning/codeql-code-scanning-for-compiled-languages
steps:
- name: Checkout repository
uses: actions/checkout@v3
uses: actions/checkout@v4

# Add any setup steps before running the `github/codeql-action/init` action.
# This includes steps like installing compilers or runtimes (`actions/setup-node`
# or others). This is typically only required for manual builds.
# - name: Setup runtime (example)
# uses: actions/setup-example@v1

# Initializes the CodeQL tools for scanning.
- name: Initialize CodeQL
uses: github/codeql-action/init@v2
uses: github/codeql-action/init@v3
with:
languages: ${{ matrix.language }}
build-mode: ${{ matrix.build-mode }}
# If you wish to specify custom queries, you can do so here or in a config file.
# By default, queries listed here will override any specified in a config file.
# Prefix the list here with "+" to use these queries and those in the config file.

# Details on CodeQL's query packs refer to : https://docs.github.com/en/code-security/code-scanning/automatically-scanning-your-code-for-vulnerabilities-and-errors/configuring-code-scanning#using-queries-in-ql-packs
# For more details on CodeQL's query packs, refer to: https://docs.github.com/en/code-security/code-scanning/automatically-scanning-your-code-for-vulnerabilities-and-errors/configuring-code-scanning#using-queries-in-ql-packs
# queries: security-extended,security-and-quality


# Autobuild attempts to build any compiled languages (C/C++, C#, Go, or Java).
# If this step fails, then you should remove it and run the build manually (see below)
- name: Autobuild
uses: github/codeql-action/autobuild@v2

# If the analyze step fails for one of the languages you are analyzing with
# "We were unable to automatically build your code", modify the matrix above
# to set the build mode to "manual" for that language. Then modify this step
# to build your code.
# ℹ️ Command-line programs to run using the OS shell.
# 📚 See https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idstepsrun

# If the Autobuild fails above, remove it and uncomment the following three lines.
# modify them (or add more) to build your code if your project, please refer to the EXAMPLE below for guidance.

# - run: |
# echo "Run, Build Application using script"
# ./location_of_script_within_repo/buildscript.sh
- if: matrix.build-mode == 'manual'
shell: bash
run: |
echo 'If you are using a "manual" build mode for one or more of the' \
'languages you are analyzing, replace this with the commands to build' \
'your code, for example:'
echo ' make bootstrap'
echo ' make release'
exit 1

- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v2
uses: github/codeql-action/analyze@v3
with:
category: "/language:${{matrix.language}}"
category: "/language:${{matrix.language}}"
10 changes: 5 additions & 5 deletions .github/workflows/PullRequest-CI.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ jobs:
github-token: '${{ secrets.GH_Packages }}'
steps:
- name: Step-01 Checkout code
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Step-02 Lint Code Base
Expand All @@ -39,7 +39,7 @@ jobs:
versionSpec: 5.x

- name: Step-02 Check out Code
uses: actions/checkout@v2
uses: actions/checkout@v4
with:
fetch-depth: 0

Expand Down Expand Up @@ -73,7 +73,7 @@ jobs:
working-directory: '${{ env.working-directory }}'

- name: Step-08 Upload Build Artifacts
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: build-artifact
path: ${{env.working-directory}}
Expand All @@ -90,7 +90,7 @@ jobs:
working-directory: /home/runner/work/ApiAggregator/ApiAggregator
steps:
- name: Step-01 Retrieve Build Artifacts
uses: actions/download-artifact@v3
uses: actions/download-artifact@v4
with:
name: build-artifact
path: ${{env.working-directory}}
Expand All @@ -111,7 +111,7 @@ jobs:
working-directory: /home/runner/work/ApiAggregator/ApiAggregator
steps:
- name: Step-01 Retrieve Build Artifacts
uses: actions/download-artifact@v3
uses: actions/download-artifact@v4
with:
name: build-artifact
path: ${{env.working-directory}}
Expand Down
79 changes: 53 additions & 26 deletions .github/workflows/PullRequest-CodeQL.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,59 +18,86 @@ on:
paths-ignore:
- "**/*.md"
- "**/*.gitignore"
- "**/*.gitattributes"
- "**/*.gitattributes"
schedule:
- cron: '35 15 * * 2'

jobs:
analyze:
name: Analyze
runs-on: ubuntu-latest
name: Analyze (${{ matrix.language }})
# Runner size impacts CodeQL analysis time. To learn more, please see:
# - https://gh.io/recommended-hardware-resources-for-running-codeql
# - https://gh.io/supported-runners-and-hardware-resources
# - https://gh.io/using-larger-runners (GitHub.com only)
# Consider using larger runners or machines with greater resources for possible analysis time improvements.
runs-on: ${{ (matrix.language == 'swift' && 'macos-latest') || 'ubuntu-latest' }}
permissions:
# required for all workflows
security-events: write

# required to fetch internal or private CodeQL packs
packages: read

# only required for workflows in private repositories
actions: read
contents: read
security-events: write

strategy:
fail-fast: false
matrix:
language: [ 'csharp' ]
# CodeQL supports [ 'cpp', 'csharp', 'go', 'java', 'javascript', 'python', 'ruby' ]
# Learn more about CodeQL language support at https://aka.ms/codeql-docs/language-support

include:
- language: actions
build-mode: none
- language: csharp
build-mode: none
# CodeQL supports the following values keywords for 'language': 'actions', 'c-cpp', 'csharp', 'go', 'java-kotlin', 'javascript-typescript', 'python', 'ruby', 'swift'
# Use `c-cpp` to analyze code written in C, C++ or both
# Use 'java-kotlin' to analyze code written in Java, Kotlin or both
# Use 'javascript-typescript' to analyze code written in JavaScript, TypeScript or both
# To learn more about changing the languages that are analyzed or customizing the build mode for your analysis,
# see https://docs.github.com/en/code-security/code-scanning/creating-an-advanced-setup-for-code-scanning/customizing-your-advanced-setup-for-code-scanning.
# If you are analyzing a compiled language, you can modify the 'build-mode' for that language to customize how
# your codebase is analyzed, see https://docs.github.com/en/code-security/code-scanning/creating-an-advanced-setup-for-code-scanning/codeql-code-scanning-for-compiled-languages
steps:
- name: Checkout repository
uses: actions/checkout@v3
uses: actions/checkout@v4

# Add any setup steps before running the `github/codeql-action/init` action.
# This includes steps like installing compilers or runtimes (`actions/setup-node`
# or others). This is typically only required for manual builds.
# - name: Setup runtime (example)
# uses: actions/setup-example@v1

# Initializes the CodeQL tools for scanning.
- name: Initialize CodeQL
uses: github/codeql-action/init@v2
uses: github/codeql-action/init@v3
with:
languages: ${{ matrix.language }}
build-mode: ${{ matrix.build-mode }}
# If you wish to specify custom queries, you can do so here or in a config file.
# By default, queries listed here will override any specified in a config file.
# Prefix the list here with "+" to use these queries and those in the config file.

# Details on CodeQL's query packs refer to : https://docs.github.com/en/code-security/code-scanning/automatically-scanning-your-code-for-vulnerabilities-and-errors/configuring-code-scanning#using-queries-in-ql-packs
# For more details on CodeQL's query packs, refer to: https://docs.github.com/en/code-security/code-scanning/automatically-scanning-your-code-for-vulnerabilities-and-errors/configuring-code-scanning#using-queries-in-ql-packs
# queries: security-extended,security-and-quality


# Autobuild attempts to build any compiled languages (C/C++, C#, Go, or Java).
# If this step fails, then you should remove it and run the build manually (see below)
- name: Autobuild
uses: github/codeql-action/autobuild@v2

# If the analyze step fails for one of the languages you are analyzing with
# "We were unable to automatically build your code", modify the matrix above
# to set the build mode to "manual" for that language. Then modify this step
# to build your code.
# ℹ️ Command-line programs to run using the OS shell.
# 📚 See https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idstepsrun

# If the Autobuild fails above, remove it and uncomment the following three lines.
# modify them (or add more) to build your code if your project, please refer to the EXAMPLE below for guidance.

# - run: |
# echo "Run, Build Application using script"
# ./location_of_script_within_repo/buildscript.sh
- if: matrix.build-mode == 'manual'
shell: bash
run: |
echo 'If you are using a "manual" build mode for one or more of the' \
'languages you are analyzing, replace this with the commands to build' \
'your code, for example:'
echo ' make bootstrap'
echo ' make release'
exit 1

- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v2
uses: github/codeql-action/analyze@v3
with:
category: "/language:${{matrix.language}}"
category: "/language:${{matrix.language}}"
2 changes: 1 addition & 1 deletion GitVersion.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
next-version: 2.0.0
next-version: 2.0.1
tag-prefix: '[vV]'
mode: ContinuousDeployment
branches:
Expand Down
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
MIT License

Copyright (c) 2024 Code Shayk
Copyright (c) 2025 Code Shayk

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# <img src="https://github.com/CodeShayk/ApiAggregator/blob/master/Images/ninja-icon-16.png" alt="ninja" style="width:30px;"/> ApiAggregator v2.0.0
# <img src="https://github.com/CodeShayk/ApiAggregator/blob/master/Images/ninja-icon-16.png" alt="ninja" style="width:30px;"/> ApiAggregator v2.0.1
[![NuGet version](https://badge.fury.io/nu/ApiAggregator.svg)](https://badge.fury.io/nu/ApiAggregator) [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://github.com/CodeShayk/ApiAggregator/blob/master/LICENSE.md)
[![Master-Build](https://github.com/CodeShayk/ApiAggregator/actions/workflows/Master-Build.yml/badge.svg)](https://github.com/CodeShayk/ApiAggregator/actions/workflows/Master-Build.yml)
[![GitHub Release](https://img.shields.io/github/v/release/CodeShayk/ApiAggregator?logo=github&sort=semver)](https://github.com/CodeShayk/ApiAggregator/releases/latest)
Expand Down
2 changes: 2 additions & 0 deletions src/ApiAggregator/ApiAggregate.cs
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
using System.Collections.Generic;

namespace ApiAggregator
{
/// <summary>
Expand All @@ -6,15 +8,15 @@
/// <typeparam name="TContract">Aggregated Contract</typeparam>
public abstract class ApiAggregate<TContract> : IApiAggregate<TContract> where TContract : IContract
{
public IEnumerable<Mapping<TContract, IApiResult>> Mappings { get; }

Check warning on line 11 in src/ApiAggregator/ApiAggregate.cs

View workflow job for this annotation

GitHub Actions / Build-Test

Missing XML comment for publicly visible type or member 'ApiAggregate<TContract>.Mappings'

public ApiAggregate()

Check warning on line 13 in src/ApiAggregator/ApiAggregate.cs

View workflow job for this annotation

GitHub Actions / Build-Test

Missing XML comment for publicly visible type or member 'ApiAggregate<TContract>.ApiAggregate()'
{
Mappings = Construct();
}

/// <summary>
/// Implement to configure mappings with Apis & result transformers.

Check warning on line 19 in src/ApiAggregator/ApiAggregate.cs

View workflow job for this annotation

GitHub Actions / Build-Test

XML comment has badly formed XML -- 'Whitespace is not allowed at this location.'
/// </summary>
/// <returns>Entity Schema mappings</returns>
public abstract IEnumerable<Mapping<TContract, IApiResult>> Construct();
Expand Down
14 changes: 8 additions & 6 deletions src/ApiAggregator/ApiAggregator.csproj
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>net9.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
<TargetFrameworks>net462; netstandard2.0;netstandard2.1;net5.0; net6.0; net8.0; net9.0</TargetFrameworks>
<ImplicitUsings>disable</ImplicitUsings>
<Nullable>disable</Nullable>
<Title>ApiAggregator</Title>
<Authors>CodeShayk</Authors>
<Company>CodeShayk</Company>
<Description>.Net utility to combine multiple api requests to return a single aggregated response. </Description>
<PackageIcon>ninja-icon-16.png</PackageIcon>
<PackageReadmeFile>README.md</PackageReadmeFile>
<GeneratePackageOnBuild>True</GeneratePackageOnBuild>
<Copyright>Copyright (c) 2024 Code Shayk</Copyright>
<Copyright>Copyright (c) 2025 Code Shayk</Copyright>
<RepositoryType></RepositoryType>
<PackageTags>api, aggregator, api-aggregator, utility, api-utility, data-aggregator, api-response, api-response-aggregator</PackageTags>
<IncludeSymbols>True</IncludeSymbols>
Expand All @@ -20,9 +20,10 @@
<GenerateDocumentationFile>True</GenerateDocumentationFile>
<PackageProjectUrl>https://github.com/CodeShayk/ApiAggregator/wiki</PackageProjectUrl>
<RepositoryUrl>https://github.com/CodeShayk/ApiAggregator</RepositoryUrl>
<PackageReleaseNotes>v2.0 - Targets .Net9.0
<PackageReleaseNotes>
v2.0.1 - Targets .Net9.0, net5.0, net6.0, net8.0, .Net Standard 2.0, and .Net Framework 4.6.2. <br />
- Includes core functionality for aggregating apis.</PackageReleaseNotes>
<Version>2.0.0</Version>
<Version>2.0.1</Version>
</PropertyGroup>

<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|AnyCPU'">
Expand All @@ -46,6 +47,7 @@

<ItemGroup>
<PackageReference Include="Microsoft.Extensions.Http" Version="9.0.0" />
<PackageReference Include="System.Text.Json" Version="4.7.2" />
</ItemGroup>

<ItemGroup>
Expand Down
2 changes: 2 additions & 0 deletions src/ApiAggregator/ApiComparer.cs
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
using System.Collections.Generic;

namespace ApiAggregator
{
internal class ApiComparer : IEqualityComparer<IWebApi>
Expand Down
3 changes: 3 additions & 0 deletions src/ApiAggregator/ApiList.cs
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
using System.Collections.Generic;
using System.Linq;

namespace ApiAggregator
{
internal class ApiList : IApiList
Expand Down Expand Up @@ -48,7 +51,7 @@
.ToList();
}

public new int Count() => apiList.Count;

Check warning on line 54 in src/ApiAggregator/ApiList.cs

View workflow job for this annotation

GitHub Actions / Build-Test

The member 'ApiList.Count()' does not hide an accessible member. The new keyword is not required.

public bool IsEmpty() => !apiList.Any();

Expand Down
2 changes: 2 additions & 0 deletions src/ApiAggregator/ApiResult.cs
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
using System.Collections.Generic;

namespace ApiAggregator
{
public abstract class ApiResult : IApiResult

Check warning on line 5 in src/ApiAggregator/ApiResult.cs

View workflow job for this annotation

GitHub Actions / Build-Test

Missing XML comment for publicly visible type or member 'ApiResult'
{
public ApiResult()

Check warning on line 7 in src/ApiAggregator/ApiResult.cs

View workflow job for this annotation

GitHub Actions / Build-Test

Missing XML comment for publicly visible type or member 'ApiResult.ApiResult()'
{
Headers = new Dictionary<string, string>();
}

public IDictionary<string, string> Headers { get; set; }

Check warning on line 12 in src/ApiAggregator/ApiResult.cs

View workflow job for this annotation

GitHub Actions / Build-Test

Missing XML comment for publicly visible type or member 'ApiResult.Headers'
}
Expand Down
2 changes: 2 additions & 0 deletions src/ApiAggregator/CacheResultAttribute.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
using System;

namespace ApiAggregator
{
public class CacheResultAttribute : Attribute

Check warning on line 5 in src/ApiAggregator/CacheResultAttribute.cs

View workflow job for this annotation

GitHub Actions / Build-Test

Missing XML comment for publicly visible type or member 'CacheResultAttribute'
{ }
Expand Down
2 changes: 2 additions & 0 deletions src/ApiAggregator/CollectionResult.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
using System.Collections.Generic;

namespace ApiAggregator
{
public class CollectionResult<T> : List<T>, IApiResult

Check warning on line 5 in src/ApiAggregator/CollectionResult.cs

View workflow job for this annotation

GitHub Actions / Build-Test

Missing XML comment for publicly visible type or member 'CollectionResult<T>'
{
public CollectionResult(IEnumerable<T> list) : base(list)
{
Expand Down
Loading
Loading