From 5202ef0144544a568f99f1c301bef7f532aa986c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ant=C3=B4nio=20Falc=C3=A3o=20Jr?= Date: Mon, 18 Jan 2021 14:14:00 -0300 Subject: [PATCH 01/12] Adjust invoke --- .../DependencyInjection/ServiceCollectionExtensions.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Dotnet5.GraphQL3.Store.Repositories/Extensions/DependencyInjection/ServiceCollectionExtensions.cs b/src/Dotnet5.GraphQL3.Store.Repositories/Extensions/DependencyInjection/ServiceCollectionExtensions.cs index bdc92b02..75d0c665 100644 --- a/src/Dotnet5.GraphQL3.Store.Repositories/Extensions/DependencyInjection/ServiceCollectionExtensions.cs +++ b/src/Dotnet5.GraphQL3.Store.Repositories/Extensions/DependencyInjection/ServiceCollectionExtensions.cs @@ -14,7 +14,7 @@ public static class ServiceCollectionExtensions public static IServiceCollection AddApplicationDbContext(this IServiceCollection services, Action options) { - options.Invoke(Options); + options(Options); return services .AddScoped() From 7620234e31f32281d0461757a1ef3f3dd9e8f35a Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 25 Jan 2021 08:30:08 +0000 Subject: [PATCH 02/12] Bump GraphQL from 3.3.1 to 3.3.2 Bumps [GraphQL](https://github.com/graphql-dotnet/graphql-dotnet) from 3.3.1 to 3.3.2. - [Release notes](https://github.com/graphql-dotnet/graphql-dotnet/releases) - [Commits](https://github.com/graphql-dotnet/graphql-dotnet/compare/3.3.1...3.3.2) Signed-off-by: dependabot[bot] --- Directory.Build.props | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Directory.Build.props b/Directory.Build.props index c9343eb0..88f2f004 100644 --- a/Directory.Build.props +++ b/Directory.Build.props @@ -15,7 +15,7 @@ 4.4.1 3.2.1 - 3.3.1 + 3.3.2 8.1.0 From db6a476355e687771656e95340738cc1103524c1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Antonio=20Falc=C3=A3o=20Jr?= Date: Mon, 25 Jan 2021 12:02:20 -0300 Subject: [PATCH 03/12] Update issue templates --- .github/ISSUE_TEMPLATE/bug_report.md | 38 +++++++++++++++++++++++ .github/ISSUE_TEMPLATE/feature_request.md | 20 ++++++++++++ 2 files changed, 58 insertions(+) create mode 100644 .github/ISSUE_TEMPLATE/bug_report.md create mode 100644 .github/ISSUE_TEMPLATE/feature_request.md diff --git a/.github/ISSUE_TEMPLATE/bug_report.md b/.github/ISSUE_TEMPLATE/bug_report.md new file mode 100644 index 00000000..dd84ea78 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/bug_report.md @@ -0,0 +1,38 @@ +--- +name: Bug report +about: Create a report to help us improve +title: '' +labels: '' +assignees: '' + +--- + +**Describe the bug** +A clear and concise description of what the bug is. + +**To Reproduce** +Steps to reproduce the behavior: +1. Go to '...' +2. Click on '....' +3. Scroll down to '....' +4. See error + +**Expected behavior** +A clear and concise description of what you expected to happen. + +**Screenshots** +If applicable, add screenshots to help explain your problem. + +**Desktop (please complete the following information):** + - OS: [e.g. iOS] + - Browser [e.g. chrome, safari] + - Version [e.g. 22] + +**Smartphone (please complete the following information):** + - Device: [e.g. iPhone6] + - OS: [e.g. iOS8.1] + - Browser [e.g. stock browser, safari] + - Version [e.g. 22] + +**Additional context** +Add any other context about the problem here. diff --git a/.github/ISSUE_TEMPLATE/feature_request.md b/.github/ISSUE_TEMPLATE/feature_request.md new file mode 100644 index 00000000..bbcbbe7d --- /dev/null +++ b/.github/ISSUE_TEMPLATE/feature_request.md @@ -0,0 +1,20 @@ +--- +name: Feature request +about: Suggest an idea for this project +title: '' +labels: '' +assignees: '' + +--- + +**Is your feature request related to a problem? Please describe.** +A clear and concise description of what the problem is. Ex. I'm always frustrated when [...] + +**Describe the solution you'd like** +A clear and concise description of what you want to happen. + +**Describe alternatives you've considered** +A clear and concise description of any alternative solutions or features you've considered. + +**Additional context** +Add any other context or screenshots about the feature request here. From 361984b482aa3901e9266bf040390e843770e1b7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Antonio=20Falc=C3=A3o=20Jr?= Date: Mon, 25 Jan 2021 12:06:49 -0300 Subject: [PATCH 04/12] Create CODE_OF_CONDUCT.md --- CODE_OF_CONDUCT.md | 76 ++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 76 insertions(+) create mode 100644 CODE_OF_CONDUCT.md diff --git a/CODE_OF_CONDUCT.md b/CODE_OF_CONDUCT.md new file mode 100644 index 00000000..c25c1664 --- /dev/null +++ b/CODE_OF_CONDUCT.md @@ -0,0 +1,76 @@ +# Contributor Covenant Code of Conduct + +## Our Pledge + +In the interest of fostering an open and welcoming environment, we as +contributors and maintainers pledge to making participation in our project and +our community a harassment-free experience for everyone, regardless of age, body +size, disability, ethnicity, sex characteristics, gender identity and expression, +level of experience, education, socio-economic status, nationality, personal +appearance, race, religion, or sexual identity and orientation. + +## Our Standards + +Examples of behavior that contributes to creating a positive environment +include: + +* Using welcoming and inclusive language +* Being respectful of differing viewpoints and experiences +* Gracefully accepting constructive criticism +* Focusing on what is best for the community +* Showing empathy towards other community members + +Examples of unacceptable behavior by participants include: + +* The use of sexualized language or imagery and unwelcome sexual attention or + advances +* Trolling, insulting/derogatory comments, and personal or political attacks +* Public or private harassment +* Publishing others' private information, such as a physical or electronic + address, without explicit permission +* Other conduct which could reasonably be considered inappropriate in a + professional setting + +## Our Responsibilities + +Project maintainers are responsible for clarifying the standards of acceptable +behavior and are expected to take appropriate and fair corrective action in +response to any instances of unacceptable behavior. + +Project maintainers have the right and responsibility to remove, edit, or +reject comments, commits, code, wiki edits, issues, and other contributions +that are not aligned to this Code of Conduct, or to ban temporarily or +permanently any contributor for other behaviors that they deem inappropriate, +threatening, offensive, or harmful. + +## Scope + +This Code of Conduct applies both within project spaces and in public spaces +when an individual is representing the project or its community. Examples of +representing a project or community include using an official project e-mail +address, posting via an official social media account, or acting as an appointed +representative at an online or offline event. Representation of a project may be +further defined and clarified by project maintainers. + +## Enforcement + +Instances of abusive, harassing, or otherwise unacceptable behavior may be +reported by contacting the project team at arfj@edu.univali.br. All +complaints will be reviewed and investigated and will result in a response that +is deemed necessary and appropriate to the circumstances. The project team is +obligated to maintain confidentiality with regard to the reporter of an incident. +Further details of specific enforcement policies may be posted separately. + +Project maintainers who do not follow or enforce the Code of Conduct in good +faith may face temporary or permanent repercussions as determined by other +members of the project's leadership. + +## Attribution + +This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4, +available at https://www.contributor-covenant.org/version/1/4/code-of-conduct.html + +[homepage]: https://www.contributor-covenant.org + +For answers to common questions about this code of conduct, see +https://www.contributor-covenant.org/faq From 7058a8604686e59ce8b7d947aae13376d0577b13 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Antonio=20Falc=C3=A3o=20Jr?= Date: Mon, 25 Jan 2021 12:18:01 -0300 Subject: [PATCH 05/12] Create pull_request_template.md --- .../pull_request_template.md | 23 +++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100644 .github/PULL_REQUEST_TEMPLATE/pull_request_template.md diff --git a/.github/PULL_REQUEST_TEMPLATE/pull_request_template.md b/.github/PULL_REQUEST_TEMPLATE/pull_request_template.md new file mode 100644 index 00000000..4aa196e0 --- /dev/null +++ b/.github/PULL_REQUEST_TEMPLATE/pull_request_template.md @@ -0,0 +1,23 @@ +* **Please check if the PR fulfills these requirements** +- [ ] The commit message follows our guidelines +- [ ] Tests for the changes have been added (for bug fixes / features) +- [ ] Docs have been added / updated (for bug fixes / features) + + +* **What kind of change does this PR introduce?** (Bug fix, feature, docs update, ...) + + + +* **What is the current behavior?** (You can also link to an open issue here) + + + +* **What is the new behavior (if this is a feature change)?** + + + +* **Does this PR introduce a breaking change?** (What changes might users need to make in their application due to this PR?) + + + +* **Other information**: From 2b6968e788b13c833164a97172217c54abe7e0df Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Antonio=20Falc=C3=A3o=20Jr?= Date: Mon, 25 Jan 2021 12:19:48 -0300 Subject: [PATCH 06/12] Create pull_request_template.md --- .github/pull_request_template.md | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100644 .github/pull_request_template.md diff --git a/.github/pull_request_template.md b/.github/pull_request_template.md new file mode 100644 index 00000000..4aa196e0 --- /dev/null +++ b/.github/pull_request_template.md @@ -0,0 +1,23 @@ +* **Please check if the PR fulfills these requirements** +- [ ] The commit message follows our guidelines +- [ ] Tests for the changes have been added (for bug fixes / features) +- [ ] Docs have been added / updated (for bug fixes / features) + + +* **What kind of change does this PR introduce?** (Bug fix, feature, docs update, ...) + + + +* **What is the current behavior?** (You can also link to an open issue here) + + + +* **What is the new behavior (if this is a feature change)?** + + + +* **Does this PR introduce a breaking change?** (What changes might users need to make in their application due to this PR?) + + + +* **Other information**: From db3ac5ecfcba453e2ad08db292ff9fa5c103e89c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Antonio=20Falc=C3=A3o=20Jr?= Date: Mon, 25 Jan 2021 12:20:17 -0300 Subject: [PATCH 07/12] Delete .github/PULL_REQUEST_TEMPLATE directory --- .../pull_request_template.md | 23 ------------------- 1 file changed, 23 deletions(-) delete mode 100644 .github/PULL_REQUEST_TEMPLATE/pull_request_template.md diff --git a/.github/PULL_REQUEST_TEMPLATE/pull_request_template.md b/.github/PULL_REQUEST_TEMPLATE/pull_request_template.md deleted file mode 100644 index 4aa196e0..00000000 --- a/.github/PULL_REQUEST_TEMPLATE/pull_request_template.md +++ /dev/null @@ -1,23 +0,0 @@ -* **Please check if the PR fulfills these requirements** -- [ ] The commit message follows our guidelines -- [ ] Tests for the changes have been added (for bug fixes / features) -- [ ] Docs have been added / updated (for bug fixes / features) - - -* **What kind of change does this PR introduce?** (Bug fix, feature, docs update, ...) - - - -* **What is the current behavior?** (You can also link to an open issue here) - - - -* **What is the new behavior (if this is a feature change)?** - - - -* **Does this PR introduce a breaking change?** (What changes might users need to make in their application due to this PR?) - - - -* **Other information**: From 107a0e0e67ae089396f12ac8b0aa6120e280cbc6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ant=C3=B4nio=20Falc=C3=A3o=20Jr?= Date: Mon, 25 Jan 2021 13:53:50 -0300 Subject: [PATCH 08/12] Adjust action --- .../DependencyInjection/ServiceCollectionExtensions.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Dotnet5.GraphQL3.Store.Repositories/Extensions/DependencyInjection/ServiceCollectionExtensions.cs b/src/Dotnet5.GraphQL3.Store.Repositories/Extensions/DependencyInjection/ServiceCollectionExtensions.cs index 75d0c665..7684124b 100644 --- a/src/Dotnet5.GraphQL3.Store.Repositories/Extensions/DependencyInjection/ServiceCollectionExtensions.cs +++ b/src/Dotnet5.GraphQL3.Store.Repositories/Extensions/DependencyInjection/ServiceCollectionExtensions.cs @@ -12,9 +12,9 @@ public static class ServiceCollectionExtensions private static readonly TimeSpan MaxRetryDelay = TimeSpan.FromSeconds(5); private static readonly RepositoriesOptions Options = new(); - public static IServiceCollection AddApplicationDbContext(this IServiceCollection services, Action options) + public static IServiceCollection AddApplicationDbContext(this IServiceCollection services, Action optionsAction) { - options(Options); + optionsAction(Options); return services .AddScoped() From c535ddfc86454f9befb6645e6fd40e9d7d74783d Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 1 Feb 2021 08:55:37 +0000 Subject: [PATCH 09/12] Bump FluentValidation from 9.4.0 to 9.5.0 Bumps [FluentValidation](https://github.com/JeremySkinner/fluentvalidation) from 9.4.0 to 9.5.0. - [Release notes](https://github.com/JeremySkinner/fluentvalidation/releases) - [Changelog](https://github.com/FluentValidation/FluentValidation/blob/master/Changelog.txt) - [Commits](https://github.com/JeremySkinner/fluentvalidation/compare/9.4.0...9.5.0) Signed-off-by: dependabot[bot] --- Directory.Build.props | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Directory.Build.props b/Directory.Build.props index 88f2f004..b45e0791 100644 --- a/Directory.Build.props +++ b/Directory.Build.props @@ -22,7 +22,7 @@ 10.1.1 - 9.4.0 + 9.5.0 3.3.0 From c8f2abab617ff294378358c8c0b1a84bcea958cb Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 1 Feb 2021 13:56:26 +0000 Subject: [PATCH 10/12] Bump Bogus from 32.0.2 to 32.1.1 Bumps [Bogus](https://github.com/bchavez/Bogus) from 32.0.2 to 32.1.1. - [Release notes](https://github.com/bchavez/Bogus/releases) - [Changelog](https://github.com/bchavez/Bogus/blob/master/HISTORY.md) - [Commits](https://github.com/bchavez/Bogus/compare/v32.0.2...v32.1.1) Signed-off-by: dependabot[bot] --- .../Dotnet5.GraphQL3.Store.Repositories.csproj | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Dotnet5.GraphQL3.Store.Repositories/Dotnet5.GraphQL3.Store.Repositories.csproj b/src/Dotnet5.GraphQL3.Store.Repositories/Dotnet5.GraphQL3.Store.Repositories.csproj index b46da542..a3e14c02 100644 --- a/src/Dotnet5.GraphQL3.Store.Repositories/Dotnet5.GraphQL3.Store.Repositories.csproj +++ b/src/Dotnet5.GraphQL3.Store.Repositories/Dotnet5.GraphQL3.Store.Repositories.csproj @@ -1,7 +1,7 @@ - + From 6c8d00784c8f73d89d1f1700e15194d1af4f313f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ant=C3=B4nio=20Falc=C3=A3o?= Date: Fri, 5 Feb 2021 18:38:41 -0300 Subject: [PATCH 11/12] merged with release --- .github/ISSUE_TEMPLATE/bug_report.md | 76 ++++----- .github/ISSUE_TEMPLATE/feature_request.md | 40 ++--- .github/pull_request_template.md | 46 +++--- CODE_OF_CONDUCT.md | 152 +++++++++--------- .../ServiceCollectionExtensions.cs | 82 +++++----- 5 files changed, 198 insertions(+), 198 deletions(-) diff --git a/.github/ISSUE_TEMPLATE/bug_report.md b/.github/ISSUE_TEMPLATE/bug_report.md index dd84ea78..6867cf8d 100644 --- a/.github/ISSUE_TEMPLATE/bug_report.md +++ b/.github/ISSUE_TEMPLATE/bug_report.md @@ -1,38 +1,38 @@ ---- -name: Bug report -about: Create a report to help us improve -title: '' -labels: '' -assignees: '' - ---- - -**Describe the bug** -A clear and concise description of what the bug is. - -**To Reproduce** -Steps to reproduce the behavior: -1. Go to '...' -2. Click on '....' -3. Scroll down to '....' -4. See error - -**Expected behavior** -A clear and concise description of what you expected to happen. - -**Screenshots** -If applicable, add screenshots to help explain your problem. - -**Desktop (please complete the following information):** - - OS: [e.g. iOS] - - Browser [e.g. chrome, safari] - - Version [e.g. 22] - -**Smartphone (please complete the following information):** - - Device: [e.g. iPhone6] - - OS: [e.g. iOS8.1] - - Browser [e.g. stock browser, safari] - - Version [e.g. 22] - -**Additional context** -Add any other context about the problem here. +--- +name: Bug report +about: Create a report to help us improve +title: '' +labels: '' +assignees: '' + +--- + +**Describe the bug** +A clear and concise description of what the bug is. + +**To Reproduce** +Steps to reproduce the behavior: +1. Go to '...' +2. Click on '....' +3. Scroll down to '....' +4. See error + +**Expected behavior** +A clear and concise description of what you expected to happen. + +**Screenshots** +If applicable, add screenshots to help explain your problem. + +**Desktop (please complete the following information):** + - OS: [e.g. iOS] + - Browser [e.g. chrome, safari] + - Version [e.g. 22] + +**Smartphone (please complete the following information):** + - Device: [e.g. iPhone6] + - OS: [e.g. iOS8.1] + - Browser [e.g. stock browser, safari] + - Version [e.g. 22] + +**Additional context** +Add any other context about the problem here. diff --git a/.github/ISSUE_TEMPLATE/feature_request.md b/.github/ISSUE_TEMPLATE/feature_request.md index bbcbbe7d..72718d5a 100644 --- a/.github/ISSUE_TEMPLATE/feature_request.md +++ b/.github/ISSUE_TEMPLATE/feature_request.md @@ -1,20 +1,20 @@ ---- -name: Feature request -about: Suggest an idea for this project -title: '' -labels: '' -assignees: '' - ---- - -**Is your feature request related to a problem? Please describe.** -A clear and concise description of what the problem is. Ex. I'm always frustrated when [...] - -**Describe the solution you'd like** -A clear and concise description of what you want to happen. - -**Describe alternatives you've considered** -A clear and concise description of any alternative solutions or features you've considered. - -**Additional context** -Add any other context or screenshots about the feature request here. +--- +name: Feature request +about: Suggest an idea for this project +title: '' +labels: '' +assignees: '' + +--- + +**Is your feature request related to a problem? Please describe.** +A clear and concise description of what the problem is. Ex. I'm always frustrated when [...] + +**Describe the solution you'd like** +A clear and concise description of what you want to happen. + +**Describe alternatives you've considered** +A clear and concise description of any alternative solutions or features you've considered. + +**Additional context** +Add any other context or screenshots about the feature request here. diff --git a/.github/pull_request_template.md b/.github/pull_request_template.md index 4aa196e0..104e9862 100644 --- a/.github/pull_request_template.md +++ b/.github/pull_request_template.md @@ -1,23 +1,23 @@ -* **Please check if the PR fulfills these requirements** -- [ ] The commit message follows our guidelines -- [ ] Tests for the changes have been added (for bug fixes / features) -- [ ] Docs have been added / updated (for bug fixes / features) - - -* **What kind of change does this PR introduce?** (Bug fix, feature, docs update, ...) - - - -* **What is the current behavior?** (You can also link to an open issue here) - - - -* **What is the new behavior (if this is a feature change)?** - - - -* **Does this PR introduce a breaking change?** (What changes might users need to make in their application due to this PR?) - - - -* **Other information**: +* **Please check if the PR fulfills these requirements** +- [ ] The commit message follows our guidelines +- [ ] Tests for the changes have been added (for bug fixes / features) +- [ ] Docs have been added / updated (for bug fixes / features) + + +* **What kind of change does this PR introduce?** (Bug fix, feature, docs update, ...) + + + +* **What is the current behavior?** (You can also link to an open issue here) + + + +* **What is the new behavior (if this is a feature change)?** + + + +* **Does this PR introduce a breaking change?** (What changes might users need to make in their application due to this PR?) + + + +* **Other information**: diff --git a/CODE_OF_CONDUCT.md b/CODE_OF_CONDUCT.md index c25c1664..40edb1af 100644 --- a/CODE_OF_CONDUCT.md +++ b/CODE_OF_CONDUCT.md @@ -1,76 +1,76 @@ -# Contributor Covenant Code of Conduct - -## Our Pledge - -In the interest of fostering an open and welcoming environment, we as -contributors and maintainers pledge to making participation in our project and -our community a harassment-free experience for everyone, regardless of age, body -size, disability, ethnicity, sex characteristics, gender identity and expression, -level of experience, education, socio-economic status, nationality, personal -appearance, race, religion, or sexual identity and orientation. - -## Our Standards - -Examples of behavior that contributes to creating a positive environment -include: - -* Using welcoming and inclusive language -* Being respectful of differing viewpoints and experiences -* Gracefully accepting constructive criticism -* Focusing on what is best for the community -* Showing empathy towards other community members - -Examples of unacceptable behavior by participants include: - -* The use of sexualized language or imagery and unwelcome sexual attention or - advances -* Trolling, insulting/derogatory comments, and personal or political attacks -* Public or private harassment -* Publishing others' private information, such as a physical or electronic - address, without explicit permission -* Other conduct which could reasonably be considered inappropriate in a - professional setting - -## Our Responsibilities - -Project maintainers are responsible for clarifying the standards of acceptable -behavior and are expected to take appropriate and fair corrective action in -response to any instances of unacceptable behavior. - -Project maintainers have the right and responsibility to remove, edit, or -reject comments, commits, code, wiki edits, issues, and other contributions -that are not aligned to this Code of Conduct, or to ban temporarily or -permanently any contributor for other behaviors that they deem inappropriate, -threatening, offensive, or harmful. - -## Scope - -This Code of Conduct applies both within project spaces and in public spaces -when an individual is representing the project or its community. Examples of -representing a project or community include using an official project e-mail -address, posting via an official social media account, or acting as an appointed -representative at an online or offline event. Representation of a project may be -further defined and clarified by project maintainers. - -## Enforcement - -Instances of abusive, harassing, or otherwise unacceptable behavior may be -reported by contacting the project team at arfj@edu.univali.br. All -complaints will be reviewed and investigated and will result in a response that -is deemed necessary and appropriate to the circumstances. The project team is -obligated to maintain confidentiality with regard to the reporter of an incident. -Further details of specific enforcement policies may be posted separately. - -Project maintainers who do not follow or enforce the Code of Conduct in good -faith may face temporary or permanent repercussions as determined by other -members of the project's leadership. - -## Attribution - -This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4, -available at https://www.contributor-covenant.org/version/1/4/code-of-conduct.html - -[homepage]: https://www.contributor-covenant.org - -For answers to common questions about this code of conduct, see -https://www.contributor-covenant.org/faq +# Contributor Covenant Code of Conduct + +## Our Pledge + +In the interest of fostering an open and welcoming environment, we as +contributors and maintainers pledge to making participation in our project and +our community a harassment-free experience for everyone, regardless of age, body +size, disability, ethnicity, sex characteristics, gender identity and expression, +level of experience, education, socio-economic status, nationality, personal +appearance, race, religion, or sexual identity and orientation. + +## Our Standards + +Examples of behavior that contributes to creating a positive environment +include: + +* Using welcoming and inclusive language +* Being respectful of differing viewpoints and experiences +* Gracefully accepting constructive criticism +* Focusing on what is best for the community +* Showing empathy towards other community members + +Examples of unacceptable behavior by participants include: + +* The use of sexualized language or imagery and unwelcome sexual attention or + advances +* Trolling, insulting/derogatory comments, and personal or political attacks +* Public or private harassment +* Publishing others' private information, such as a physical or electronic + address, without explicit permission +* Other conduct which could reasonably be considered inappropriate in a + professional setting + +## Our Responsibilities + +Project maintainers are responsible for clarifying the standards of acceptable +behavior and are expected to take appropriate and fair corrective action in +response to any instances of unacceptable behavior. + +Project maintainers have the right and responsibility to remove, edit, or +reject comments, commits, code, wiki edits, issues, and other contributions +that are not aligned to this Code of Conduct, or to ban temporarily or +permanently any contributor for other behaviors that they deem inappropriate, +threatening, offensive, or harmful. + +## Scope + +This Code of Conduct applies both within project spaces and in public spaces +when an individual is representing the project or its community. Examples of +representing a project or community include using an official project e-mail +address, posting via an official social media account, or acting as an appointed +representative at an online or offline event. Representation of a project may be +further defined and clarified by project maintainers. + +## Enforcement + +Instances of abusive, harassing, or otherwise unacceptable behavior may be +reported by contacting the project team at arfj@edu.univali.br. All +complaints will be reviewed and investigated and will result in a response that +is deemed necessary and appropriate to the circumstances. The project team is +obligated to maintain confidentiality with regard to the reporter of an incident. +Further details of specific enforcement policies may be posted separately. + +Project maintainers who do not follow or enforce the Code of Conduct in good +faith may face temporary or permanent repercussions as determined by other +members of the project's leadership. + +## Attribution + +This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4, +available at https://www.contributor-covenant.org/version/1/4/code-of-conduct.html + +[homepage]: https://www.contributor-covenant.org + +For answers to common questions about this code of conduct, see +https://www.contributor-covenant.org/faq diff --git a/src/Dotnet5.GraphQL3.Store.Repositories/Extensions/DependencyInjection/ServiceCollectionExtensions.cs b/src/Dotnet5.GraphQL3.Store.Repositories/Extensions/DependencyInjection/ServiceCollectionExtensions.cs index 7684124b..2f2dba7d 100644 --- a/src/Dotnet5.GraphQL3.Store.Repositories/Extensions/DependencyInjection/ServiceCollectionExtensions.cs +++ b/src/Dotnet5.GraphQL3.Store.Repositories/Extensions/DependencyInjection/ServiceCollectionExtensions.cs @@ -1,42 +1,42 @@ -using System; -using Dotnet5.GraphQL3.Store.Repositories.Contexts; -using Microsoft.EntityFrameworkCore; -using Microsoft.EntityFrameworkCore.Infrastructure; -using Microsoft.Extensions.DependencyInjection; - -namespace Dotnet5.GraphQL3.Store.Repositories.Extensions.DependencyInjection -{ - public static class ServiceCollectionExtensions - { - private const int MaxRetryCount = 5; - private static readonly TimeSpan MaxRetryDelay = TimeSpan.FromSeconds(5); - private static readonly RepositoriesOptions Options = new(); - - public static IServiceCollection AddApplicationDbContext(this IServiceCollection services, Action optionsAction) - { - optionsAction(Options); - - return services - .AddScoped() - .AddDbContext(DbContextOptionsBuilderAction); - } - - private static void DbContextOptionsBuilderAction(DbContextOptionsBuilder optionsBuilder) - => optionsBuilder - .EnableDetailedErrors() - .EnableSensitiveDataLogging() - .UseSqlServer( - connectionString: Options.ConnectionString, - sqlServerOptionsAction: SqlServerOptionsAction); - - private static void SqlServerOptionsAction(SqlServerDbContextOptionsBuilder optionsBuilder) - => optionsBuilder - .EnableRetryOnFailure(MaxRetryCount, MaxRetryDelay, null) - .MigrationsAssembly(typeof(StoreDbContext).Assembly.GetName().Name); - } - - public class RepositoriesOptions - { - public string ConnectionString { get; set; } - } +using System; +using Dotnet5.GraphQL3.Store.Repositories.Contexts; +using Microsoft.EntityFrameworkCore; +using Microsoft.EntityFrameworkCore.Infrastructure; +using Microsoft.Extensions.DependencyInjection; + +namespace Dotnet5.GraphQL3.Store.Repositories.Extensions.DependencyInjection +{ + public static class ServiceCollectionExtensions + { + private const int MaxRetryCount = 5; + private static readonly TimeSpan MaxRetryDelay = TimeSpan.FromSeconds(5); + private static readonly RepositoriesOptions Options = new(); + + public static IServiceCollection AddApplicationDbContext(this IServiceCollection services, Action optionsAction) + { + optionsAction(Options); + + return services + .AddScoped() + .AddDbContext(DbContextOptionsBuilderAction); + } + + private static void DbContextOptionsBuilderAction(DbContextOptionsBuilder optionsBuilder) + => optionsBuilder + .EnableDetailedErrors() + .EnableSensitiveDataLogging() + .UseSqlServer( + connectionString: Options.ConnectionString, + sqlServerOptionsAction: SqlServerOptionsAction); + + private static void SqlServerOptionsAction(SqlServerDbContextOptionsBuilder optionsBuilder) + => optionsBuilder + .EnableRetryOnFailure(MaxRetryCount, MaxRetryDelay, null) + .MigrationsAssembly(typeof(StoreDbContext).Assembly.GetName().Name); + } + + public class RepositoriesOptions + { + public string ConnectionString { get; set; } + } } \ No newline at end of file From 10934ffcaadb7d2b98cccee59dc15e062d442090 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ant=C3=B4nio=20Falc=C3=A3o?= Date: Sat, 6 Feb 2021 12:05:04 -0300 Subject: [PATCH 12/12] Adding database resilience --- .dockerignore | 46 ++++---- .vscode/tasks.json | 82 ++++++------- .../ServiceCollectionExtensions.cs | 110 +++++++++++------- src/Dotnet5.GraphQL3.Store.WebAPI/Startup.cs | 7 +- .../appsettings.json | 5 + 5 files changed, 143 insertions(+), 107 deletions(-) diff --git a/.dockerignore b/.dockerignore index 257cb48d..33d43c08 100644 --- a/.dockerignore +++ b/.dockerignore @@ -1,24 +1,24 @@ -**/.classpath -**/.dockerignore -**/.env -**/.git -**/.gitignore -**/.project -**/.settings -**/.toolstarget -**/.vs -**/.vscode -**/*.*proj.user -**/*.dbmdl -**/*.jfm -**/azds.yaml -**/bin -**/charts -**/docker-compose* -**/Dockerfile* -**/node_modules -**/npm-debug.log -**/obj -**/secrets.dev.yaml -**/values.dev.yaml +**/.classpath +**/.dockerignore +**/.env +**/.git +**/.gitignore +**/.project +**/.settings +**/.toolstarget +**/.vs +**/.vscode +**/*.*proj.user +**/*.dbmdl +**/*.jfm +**/azds.yaml +**/bin +**/charts +**/docker-compose* +**/Dockerfile* +**/node_modules +**/npm-debug.log +**/obj +**/secrets.dev.yaml +**/values.dev.yaml README.md \ No newline at end of file diff --git a/.vscode/tasks.json b/.vscode/tasks.json index 543a30db..5fe850b7 100644 --- a/.vscode/tasks.json +++ b/.vscode/tasks.json @@ -1,42 +1,42 @@ -{ - "version": "2.0.0", - "tasks": [ - { - "label": "build", - "command": "dotnet", - "type": "process", - "args": [ - "build", - "${workspaceFolder}/src/Dotnet5.GraphQL3.Store.WebAPI/Dotnet5.GraphQL3.Store.WebAPI.csproj", - "/property:GenerateFullPaths=true", - "/consoleloggerparameters:NoSummary" - ], - "problemMatcher": "$msCompile" - }, - { - "label": "publish", - "command": "dotnet", - "type": "process", - "args": [ - "publish", - "${workspaceFolder}/src/Dotnet5.GraphQL3.Store.WebAPI/Dotnet5.GraphQL3.Store.WebAPI.csproj", - "/property:GenerateFullPaths=true", - "/consoleloggerparameters:NoSummary" - ], - "problemMatcher": "$msCompile" - }, - { - "label": "watch", - "command": "dotnet", - "type": "process", - "args": [ - "watch", - "run", - "${workspaceFolder}/src/Dotnet5.GraphQL3.Store.WebAPI/Dotnet5.GraphQL3.Store.WebAPI.csproj", - "/property:GenerateFullPaths=true", - "/consoleloggerparameters:NoSummary" - ], - "problemMatcher": "$msCompile" - } - ] +{ + "version": "2.0.0", + "tasks": [ + { + "label": "build", + "command": "dotnet", + "type": "process", + "args": [ + "build", + "${workspaceFolder}/src/Dotnet5.GraphQL3.Store.WebAPI/Dotnet5.GraphQL3.Store.WebAPI.csproj", + "/property:GenerateFullPaths=true", + "/consoleloggerparameters:NoSummary" + ], + "problemMatcher": "$msCompile" + }, + { + "label": "publish", + "command": "dotnet", + "type": "process", + "args": [ + "publish", + "${workspaceFolder}/src/Dotnet5.GraphQL3.Store.WebAPI/Dotnet5.GraphQL3.Store.WebAPI.csproj", + "/property:GenerateFullPaths=true", + "/consoleloggerparameters:NoSummary" + ], + "problemMatcher": "$msCompile" + }, + { + "label": "watch", + "command": "dotnet", + "type": "process", + "args": [ + "watch", + "run", + "${workspaceFolder}/src/Dotnet5.GraphQL3.Store.WebAPI/Dotnet5.GraphQL3.Store.WebAPI.csproj", + "/property:GenerateFullPaths=true", + "/consoleloggerparameters:NoSummary" + ], + "problemMatcher": "$msCompile" + } + ] } \ No newline at end of file diff --git a/src/Dotnet5.GraphQL3.Store.Repositories/Extensions/DependencyInjection/ServiceCollectionExtensions.cs b/src/Dotnet5.GraphQL3.Store.Repositories/Extensions/DependencyInjection/ServiceCollectionExtensions.cs index 2f2dba7d..ca48fe23 100644 --- a/src/Dotnet5.GraphQL3.Store.Repositories/Extensions/DependencyInjection/ServiceCollectionExtensions.cs +++ b/src/Dotnet5.GraphQL3.Store.Repositories/Extensions/DependencyInjection/ServiceCollectionExtensions.cs @@ -1,42 +1,70 @@ -using System; -using Dotnet5.GraphQL3.Store.Repositories.Contexts; -using Microsoft.EntityFrameworkCore; -using Microsoft.EntityFrameworkCore.Infrastructure; -using Microsoft.Extensions.DependencyInjection; - -namespace Dotnet5.GraphQL3.Store.Repositories.Extensions.DependencyInjection -{ - public static class ServiceCollectionExtensions - { - private const int MaxRetryCount = 5; - private static readonly TimeSpan MaxRetryDelay = TimeSpan.FromSeconds(5); - private static readonly RepositoriesOptions Options = new(); - - public static IServiceCollection AddApplicationDbContext(this IServiceCollection services, Action optionsAction) - { - optionsAction(Options); - - return services - .AddScoped() - .AddDbContext(DbContextOptionsBuilderAction); - } - - private static void DbContextOptionsBuilderAction(DbContextOptionsBuilder optionsBuilder) - => optionsBuilder - .EnableDetailedErrors() - .EnableSensitiveDataLogging() - .UseSqlServer( - connectionString: Options.ConnectionString, - sqlServerOptionsAction: SqlServerOptionsAction); - - private static void SqlServerOptionsAction(SqlServerDbContextOptionsBuilder optionsBuilder) - => optionsBuilder - .EnableRetryOnFailure(MaxRetryCount, MaxRetryDelay, null) - .MigrationsAssembly(typeof(StoreDbContext).Assembly.GetName().Name); - } - - public class RepositoriesOptions - { - public string ConnectionString { get; set; } - } +using System; +using Dotnet5.GraphQL3.Store.Repositories.Contexts; +using Microsoft.EntityFrameworkCore; +using Microsoft.EntityFrameworkCore.Infrastructure; +using Microsoft.Extensions.DependencyInjection; + +namespace Dotnet5.GraphQL3.Store.Repositories.Extensions.DependencyInjection +{ + public static class ServiceCollectionExtensions + { + private static readonly RepositoryOptions Options = new(); + + public static IServiceCollection AddApplicationDbContext(this IServiceCollection services, Action optionsAction) + { + optionsAction(Options); + + return services + .AddScoped() + .AddDbContext(DbContextOptionsBuilderAction); + } + + private static void DbContextOptionsBuilderAction(DbContextOptionsBuilder optionsBuilder) + => optionsBuilder + .EnableDetailedErrors() + .EnableSensitiveDataLogging() + .UseSqlServer( + connectionString: Options.ConnectionString, + sqlServerOptionsAction: SqlServerOptionsAction); + + private static void SqlServerOptionsAction(SqlServerDbContextOptionsBuilder optionsBuilder) + => optionsBuilder + .EnableRetryOnFailure( + maxRetryCount: Options.ResilientConnection.MaxRetryCount, + maxRetryDelay: Options.ResilientConnection.MaxRetryDelay, + errorNumbersToAdd: Options.ResilientConnection.ErrorNumbersToAdd) + .MigrationsAssembly(typeof(StoreDbContext).Assembly.GetName().Name); + } + + public class DatabaseResilientConnection + { + private const int DefaultMaxRetryCount = 5; + private const int DefaultMaxRetryDelay = 5; + + private int _maxRetryCount; + private int _maxSecondsRetryDelay; + + public int MaxRetryCount + { + get => _maxRetryCount; + set => _maxRetryCount = value is default(int) ? DefaultMaxRetryCount : value; + } + + public int MaxSecondsRetryDelay + { + get => _maxSecondsRetryDelay; + set => _maxSecondsRetryDelay = value is default(int) ? DefaultMaxRetryDelay : value; + } + + public int[] ErrorNumbersToAdd { get; set; } + + internal TimeSpan MaxRetryDelay + => TimeSpan.FromSeconds(MaxSecondsRetryDelay); + } + + public class RepositoryOptions + { + public string ConnectionString { get; set; } + public DatabaseResilientConnection ResilientConnection { get; set; } = new(); + } } \ No newline at end of file diff --git a/src/Dotnet5.GraphQL3.Store.WebAPI/Startup.cs b/src/Dotnet5.GraphQL3.Store.WebAPI/Startup.cs index 4a89e429..a683dbfb 100644 --- a/src/Dotnet5.GraphQL3.Store.WebAPI/Startup.cs +++ b/src/Dotnet5.GraphQL3.Store.WebAPI/Startup.cs @@ -60,8 +60,11 @@ public void ConfigureServices(IServiceCollection services) .AddSubjects() .AddNotificationContext(); - services.AddApplicationDbContext(options - => options.ConnectionString = _configuration.GetConnectionString("DefaultConnection")); + services.AddApplicationDbContext(options => + { + options.ConnectionString = _configuration.GetConnectionString("DefaultConnection"); + _configuration.Bind("DatabaseResilientConnection", options.ResilientConnection); + }); services.AddApplicationGraphQL(options => options.IsDevelopment = _env.IsDevelopment()); diff --git a/src/Dotnet5.GraphQL3.Store.WebAPI/appsettings.json b/src/Dotnet5.GraphQL3.Store.WebAPI/appsettings.json index 417be31d..7a136bf1 100644 --- a/src/Dotnet5.GraphQL3.Store.WebAPI/appsettings.json +++ b/src/Dotnet5.GraphQL3.Store.WebAPI/appsettings.json @@ -2,6 +2,11 @@ "ConnectionStrings": { "DefaultConnection": "Server=mssql;Database=Store;User=sa;Password=!MyComplexPassword" }, + "DatabaseResilientConnection": { + "MaxRetryCount": 5, + "MaxRetryDelay": 5, + "ErrorNumbersToAdd": [] + }, "Logging": { "LogLevel": { "Default": "Information",