Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/main'
Browse files Browse the repository at this point in the history
  • Loading branch information
urbanit committed Mar 25, 2024
2 parents 5aeeb98 + 4a01876 commit 9a67e6d
Show file tree
Hide file tree
Showing 2,727 changed files with 44,007 additions and 22,629 deletions.
65 changes: 60 additions & 5 deletions .all-contributorsrc
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"repoType": "github",
"repoHost": "https://github.com",
"files": [
"Contributors.md"
"src/docs/community/contributors/README.md"
],
"imageSize": 100,
"commit": true,
Expand Down Expand Up @@ -1805,10 +1805,10 @@
]
},
{
"login": "DAud-IcI",
"name": "El-Saig Dávid",
"login": "sarahelsaig",
"name": "Sára El-Saig",
"avatar_url": "https://avatars1.githubusercontent.com/u/4007293?v=4",
"profile": "https://github.com/DAud-IcI",
"profile": "https://github.com/sarahelsaig",
"contributions": [
"code"
]
Expand Down Expand Up @@ -2807,7 +2807,62 @@
"contributions": [
"code"
]
},
{
"login": "viktoriamagyar",
"name": "Viktória Magyar",
"avatar_url": "https://avatars.githubusercontent.com/u/84029837?v=4",
"profile": "https://github.com/viktoriamagyar",
"contributions": [
"eventOrganizing"
]
},
{
"login": "SimonCropp",
"name": "Simon Cropp",
"avatar_url": "https://avatars.githubusercontent.com/u/122666?v=4",
"profile": "https://github.com/SimonCropp",
"contributions": [
"code"
]
},
{
"login": "w-ko",
"name": "Holerö",
"avatar_url": "https://avatars.githubusercontent.com/u/126988022?v=4",
"profile": "https://github.com/w-ko",
"contributions": [
"code"
]
},
{
"login": "aliamiras",
"name": "aliamiras",
"avatar_url": "https://avatars.githubusercontent.com/u/107989021?v=4",
"profile": "https://github.com/aliamiras",
"contributions": [
"code"
]
},
{
"login": "xtomas",
"name": "Tomáš Jákl",
"avatar_url": "https://avatars.githubusercontent.com/u/10938220?v=4",
"profile": "https://github.com/xtomas",
"contributions": [
"code"
]
},
{
"login": "porgabi",
"name": "Gábor Pór",
"avatar_url": "https://avatars.githubusercontent.com/u/51411356?v=4",
"profile": "https://github.com/porgabi",
"contributions": [
"code"
]
}
],
"skipCi": true
"skipCi": true,
"commitType": "docs"
}
47 changes: 28 additions & 19 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
root = true
root = true

[*]
end_of_line = crlf
Expand All @@ -11,27 +11,36 @@ indent_size = 2

[*.cs]
# Prefer "var" everywhere
csharp_style_var_for_built_in_types = true : suggestion
csharp_style_var_when_type_is_apparent = true : suggestion
csharp_style_var_elsewhere = true : suggestion
csharp_style_var_for_built_in_types = true : suggestion
csharp_style_var_when_type_is_apparent = true : suggestion
csharp_style_var_elsewhere = true : suggestion

# Newline settings
csharp_new_line_before_open_brace = all
csharp_new_line_before_else = true
csharp_new_line_before_catch = true
csharp_new_line_before_finally = true
csharp_new_line_before_members_in_object_initializers = true
csharp_new_line_before_members_in_anonymous_types = true
csharp_new_line_before_open_brace = all
csharp_new_line_before_else = true
csharp_new_line_before_catch = true
csharp_new_line_before_finally = true
csharp_new_line_before_members_in_object_initializers = true
csharp_new_line_before_members_in_anonymous_types = true

dotnet_diagnostic.IDE0290.severity = none
dotnet_diagnostic.IDE0305.severity = none

# Sort using and Import directives with System.* appearing first
dotnet_sort_system_directives_first = true

# Code-block preferences
csharp_prefer_braces = true
csharp_prefer_simple_using_statement = true
csharp_style_namespace_declarations = file_scoped
csharp_prefer_simple_using_statement = true
csharp_style_namespace_declarations = file_scoped:suggestion

# Range operator
csharp_style_prefer_range_operator = false:warning
csharp_style_prefer_index_operator = false:warning
dotnet_diagnostic.IDE0057.severity = warning
dotnet_diagnostic.IDE0056.severity = warning

# Avoid "this." if not necessary
# Avoid "this." if not necessary
dotnet_style_qualification_for_field = false : suggestion
dotnet_style_qualification_for_property = false : suggestion
dotnet_style_qualification_for_method = false : suggestion
Expand All @@ -42,11 +51,11 @@ dotnet_style_predefined_type_for_locals_parameters_members = true : suggestion
dotnet_style_predefined_type_for_member_access = true : suggestion

# Suggest more modern language features when available
csharp_style_pattern_matching_over_is_with_cast_check = true : none
csharp_style_pattern_matching_over_as_with_null_check = true : none
csharp_style_inlined_variable_declaration = true : none
csharp_style_throw_expression = true : none
csharp_style_conditional_delegate_call = true : none
csharp_style_pattern_matching_over_is_with_cast_check = true : none
csharp_style_pattern_matching_over_as_with_null_check = true : none
csharp_style_inlined_variable_declaration = true : none
csharp_style_throw_expression = true : none
csharp_style_conditional_delegate_call = true : none

dotnet_style_object_initializer = true : suggestion
dotnet_style_collection_initializer = true : suggestion
Expand Down Expand Up @@ -194,7 +203,7 @@ dotnet_diagnostic.SA1314.severity = none # Type parameter names shoul

# StyleCop: Maintainability Rules
dotnet_diagnostic.SA1400.severity = none # Access modifier should be declared.
dotnet_diagnostic.SA1401.severity = none # Fields should be privat.
dotnet_diagnostic.SA1401.severity = none # Fields should be private.
dotnet_diagnostic.SA1402.severity = none # File may only contain a single type.
dotnet_diagnostic.SA1403.severity = none # File may only contain a single namespace.
dotnet_diagnostic.SA1404.severity = none # Code analysis suppression should have justification.
Expand Down
18 changes: 18 additions & 0 deletions .github/workflows/contributor_map.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
name: Contributor Map

on:
# Running this automatically would require jumping through a lot of hoops because tunaitis/contributor-map commits to
# the branch where the workflow was triggered, i.e. `main` for the schedule trigger. So, better to occasionally run
# it manually in a PR.
workflow_dispatch:

jobs:
update-contributor-map:
name: Update Contributor Map
runs-on: ubuntu-latest

steps:
- name: Update Contributor Map
uses: tunaitis/contributor-map@da8a84b848781bccaa56bc73519c055f4814e512 #v1
with:
output: src/docs/community/contributors/images/contributors-map.svg
81 changes: 81 additions & 0 deletions .github/workflows/issue-metrics.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,81 @@
name: Monthly Issue and Pull Request Metrics
on:
workflow_dispatch:
schedule:
# Run on the first day of every month at 2:19 AM UTC.
- cron: '19 2 1 * *'

permissions:
issues: write
pull-requests: read

jobs:
build:
name: Generate Issue and Pull Request Metrics
runs-on: ubuntu-latest
steps:
- name: Get Dates For Last Month
shell: pwsh
run: |
# Calculate the first day of the previous month.
$firstDay = (Get-Date).AddMonths(-1).ToString("yyyy-MM-01")
# Calculate the last day of the previous month.
$lastDay = (Get-Date $firstDay).AddMonths(1).AddDays(-1).ToString("yyyy-MM-dd")

# Set an environment variable with the date range.
Write-Output "$firstDay..$lastDay"
Write-Output "LAST_MONTH=$firstDay..$lastDay" >> $env:GITHUB_ENV

- name: Compute Issue Metrics
uses: github/issue-metrics@v2
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
SEARCH_QUERY: 'repo:OrchardCMS/OrchardCore is:issue created:${{ env.LAST_MONTH }} -reason:"not planned" -label:"community metrics"'
HIDE_TIME_TO_ANSWER: true

- name: Rename Issue Metrics File
shell: pwsh
run: |
# Renaming the file wouldn't work since other scripts will be denied access to it for some reason.
Add-Content -Path ./community_metrics.md -Value (Get-Content -Path ./issue_metrics.md -Raw)
- name: Compute Pull Request Metrics
uses: github/issue-metrics@v2
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
SEARCH_QUERY: 'repo:OrchardCMS/OrchardCore is:pr created:${{ env.LAST_MONTH }} -label:dontmerge -label:notready -is:draft'
HIDE_TIME_TO_ANSWER: true

- name: Concatenate Issue and Pull Request Metrics
shell: pwsh
run: |
$content = (Get-Content -Path ./issue_metrics.md -Raw) -replace '# Issue Metrics', '# Pull Request Metrics'
Add-Content -Path ./community_metrics.md -Value ([Environment]::NewLine + $content)
- name: Compute Q&A Discussion Request Metrics
uses: github/issue-metrics@v2
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
SEARCH_QUERY: 'repo:OrchardCMS/OrchardCore type:discussions created:${{ env.LAST_MONTH }} category:Q&A'
HIDE_TIME_TO_CLOSE: true

- name: Concatenate Issue/PR and Discussion Metrics
shell: pwsh
run: |
$content = (Get-Content -Path ./issue_metrics.md -Raw) -replace '# Issue Metrics', '# Discussion Metrics'
Add-Content -Path ./community_metrics.md -Value ([Environment]::NewLine + $content)
- name: Display Issue Metrics in Summary
shell: pwsh
run: |
Get-Content ./community_metrics.md >> $env:GITHUB_STEP_SUMMARY
- name: Create Issue
# v4.0.1
uses: peter-evans/create-issue-from-file@433e51abf769039ee20ba1293a088ca19d573b7f
with:
title: Monthly community metrics report for ${{ env.LAST_MONTH }}
token: ${{ secrets.GITHUB_TOKEN }}
content-filepath: ./community_metrics.md
labels: community metrics
2 changes: 1 addition & 1 deletion .github/workflows/mac_unit_test_ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,5 +13,5 @@ jobs:
- uses: actions/checkout@v3
- name: Build and test
run: |
dotnet build -c Release -f net8.0
dotnet build -c Release
dotnet test -c Release --no-restore --no-build ./test/OrchardCore.Tests/OrchardCore.Tests.csproj
3 changes: 1 addition & 2 deletions .github/workflows/pr_ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ jobs:
dotnet-version: '8.0.x'
- name: Build
run: |
dotnet build -c Release -f net8.0
dotnet build -c Release
- name: Unit Tests
run: |
dotnet test -c Release --no-build ./test/OrchardCore.Tests/OrchardCore.Tests.csproj
Expand All @@ -44,4 +44,3 @@ jobs:
path: |
test/OrchardCore.Tests.Functional/cms-tests/cypress/screenshots
src/OrchardCore.Cms.Web/App_Data/logs
25 changes: 9 additions & 16 deletions .github/workflows/preview_ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ jobs:
run: echo "BuildNumber=$(( $GITHUB_RUN_NUMBER + 16368 ))" >> $GITHUB_ENV
- name: Build
run: |
dotnet build -c Release -f net8.0
dotnet build -c Release
- name: Unit Tests
run: |
dotnet test -c Release --no-build ./test/OrchardCore.Tests/OrchardCore.Tests.csproj
Expand All @@ -53,29 +53,22 @@ jobs:
run: |
dotnet pack -c Release --no-build
dotnet nuget push './src/**/*.nupkg' -t 600 -k ${{secrets.CLOUDSMITH_API_KEY}} -n -s https://nuget.cloudsmith.io/orchardcore/preview/v3/index.json --skip-duplicate
- name: Set up Docker Buildx
if: matrix.os == 'ubuntu-latest'
uses: docker/setup-buildx-action@v3
- name: Login to DockerHub
if: matrix.os == 'ubuntu-latest'
uses: docker/login-action@v1
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_PASSWORD }}
- name: Deploy preview docker image for linux
shell: pwsh
- name: Deploy preview docker images
if: matrix.os == 'ubuntu-latest'
shell: pwsh
run: |
Get-ChildItem ./src/OrchardCore.Cms.Web/App_Data -Recurse | Remove-Item -Recurse -Confirm:$false
Get-ChildItem ./src/OrchardCore.Cms.Web/App_Data_Tests -Recurse | Remove-Item -Recurse -Confirm:$false
$output = [System.IO.Path]::GetFullPath("./.build/release")
dotnet publish -c Release --property:PublishDir=$output --no-build --framework net8.0
docker build -f Dockerfile-CI --platform=linux/amd64 -t orchardproject/orchardcore-cms-linux:dev .
docker push orchardproject/orchardcore-cms-linux:dev
- name: Deploy preview docker image for windows
if: matrix.os == 'windows-latest'
run: |
Get-ChildItem ./src/OrchardCore.Cms.Web/App_Data -Recurse | Remove-Item -Recurse -Confirm:$false
Get-ChildItem ./src/OrchardCore.Cms.Web/App_Data_Tests -Recurse | Remove-Item -Recurse -Confirm:$false
$output = [System.IO.Path]::GetFullPath("./.build/release")
dotnet publish -c Release --property:PublishDir=$output --no-build --framework net8.0
docker build -f Dockerfile-CI --platform=windows/amd64 -t orchardproject/orchardcore-cms-windows:dev .
echo "${{ secrets.DOCKERHUB_PASSWORD }}" | docker login -u="${{ secrets.DOCKERHUB_USERNAME }}" --password-stdin
docker push orchardproject/orchardcore-cms-windows:dev
docker buildx build -f Dockerfile-CI --platform=linux/amd64 -t orchardproject/orchardcore-cms-linux:dev --push .
docker buildx build -f Dockerfile-CI --platform=windows/amd64 -t orchardproject/orchardcore-cms-windows:dev --push .
27 changes: 9 additions & 18 deletions .github/workflows/release_ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ jobs:
run: echo "BuildNumber=$(( $GITHUB_RUN_NUMBER + 15471 ))" >> $GITHUB_ENV
- name: Build
run: |
dotnet build -c Release -f net8.0 -p:Version=${{ steps.get_version.outputs.VERSION }}
dotnet build -c Release -p:Version=${{ steps.get_version.outputs.VERSION }}
- name: Unit Tests
run: |
dotnet test -c Release --no-build ./test/OrchardCore.Tests/OrchardCore.Tests.csproj
Expand All @@ -64,31 +64,22 @@ jobs:
run: |
dotnet pack -c Release --no-build -p:Version=${{ steps.get_version.outputs.VERSION }} -p:TreatWarningsAsErrors=false
dotnet nuget push './src/**/*.nupkg' -t 600 -k ${{secrets.NUGET_API_KEY}} -s https://api.nuget.org/v3/index.json --skip-duplicate
- name: Set up Docker Buildx
if: matrix.os == 'ubuntu-latest'
uses: docker/setup-buildx-action@v3
- name: Login to DockerHub
if: matrix.os == 'ubuntu-latest'
uses: docker/login-action@v1
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_PASSWORD }}
- name: Deploy release docker image for linux
shell: pwsh
- name: Deploy release docker images
if: matrix.os == 'ubuntu-latest'
shell: pwsh
run: |
Get-ChildItem ./src/OrchardCore.Cms.Web/App_Data -Recurse | Remove-Item -Recurse -Confirm:$false
Get-ChildItem ./src/OrchardCore.Cms.Web/App_Data_Tests -Recurse | Remove-Item -Recurse -Confirm:$false
$output = [System.IO.Path]::GetFullPath("./.build/release")
dotnet publish -c Release --property:PublishDir=$output --no-build --framework net8.0
docker build -f Dockerfile-CI --platform=linux/amd64 -t orchardproject/orchardcore-cms-linux:latest -t orchardproject/orchardcore-cms-linux:${{ steps.get_version.outputs.VERSION }} .
docker push orchardproject/orchardcore-cms-linux:latest
docker push "orchardproject/orchardcore-cms-linux:${{ steps.get_version.outputs.VERSION }}"
- name: Deploy preview docker image for windows
if: matrix.os == 'windows-latest'
run: |
Get-ChildItem ./src/OrchardCore.Cms.Web/App_Data -Recurse | Remove-Item -Recurse -Confirm:$false
Get-ChildItem ./src/OrchardCore.Cms.Web/App_Data_Tests -Recurse | Remove-Item -Recurse -Confirm:$false
$output = [System.IO.Path]::GetFullPath("./.build/release")
dotnet publish -c Release --property:PublishDir=$output --no-build --framework net8.0
docker build -f Dockerfile-CI --platform=windows/amd64 -t orchardproject/orchardcore-cms-windows:latest -t orchardproject/orchardcore-cms-windows:${{ steps.get_version.outputs.VERSION }} .
echo "${{ secrets.DOCKERHUB_PASSWORD }}" | docker login -u="${{ secrets.DOCKERHUB_USERNAME }}" --password-stdin
docker push orchardproject/orchardcore-cms-windows:latest
docker push "orchardproject/orchardcore-cms-windows:${{ steps.get_version.outputs.VERSION }}"
docker buildx build -f Dockerfile-CI --platform=linux/amd64 -t orchardproject/orchardcore-cms-linux:latest -t orchardproject/orchardcore-cms-linux:${{ steps.get_version.outputs.VERSION }} --push .
docker buildx build -f Dockerfile-CI --platform=windows/amd64 -t orchardproject/orchardcore-cms-windows:latest -t orchardproject/orchardcore-cms-windows:${{ steps.get_version.outputs.VERSION }} --push .
Loading

0 comments on commit 9a67e6d

Please sign in to comment.