Граф коммитов

108 Коммитов

Автор SHA1 Сообщение Дата
Andrea Spadaccini 504e372b05
fix: remove () from type name in tests (#70)
Tests are failing on pwsh 7.4 because it stopped accepting `'System.Collections.ArrayList()'` as an argument to `New-Object`.

Removing the extra parentheses should fix the issue.
2024-01-03 17:39:21 +01:00
Andrea Spadaccini 9986a81863
Add tests for pwsh 7.3 and 7.4 (#69)
Fixes #58
2023-12-20 10:33:42 +01:00
dependabot[bot] 1926b5aaa9
Bump github/codeql-action from 2 to 3 (#68)
Bumps [github/codeql-action](https://github.com/github/codeql-action) from 2 to 3.
- [Release notes](https://github.com/github/codeql-action/releases)
- [Changelog](https://github.com/github/codeql-action/blob/main/CHANGELOG.md)
- [Commits](https://github.com/github/codeql-action/compare/v2...v3)

---
updated-dependencies:
- dependency-name: github/codeql-action
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-12-14 11:25:26 +01:00
dependabot[bot] 384a9cf65d
Bump microsoft/psscriptanalyzer-action from 1.0 to 1.1 (#66)
Bumps [microsoft/psscriptanalyzer-action](https://github.com/microsoft/psscriptanalyzer-action) from 1.0 to 1.1.
- [Release notes](https://github.com/microsoft/psscriptanalyzer-action/releases)
- [Commits](2044ae068e...6b2948b194)

---
updated-dependencies:
- dependency-name: microsoft/psscriptanalyzer-action
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Andrea Spadaccini <andrea.spadaccini@microsoft.com>
2023-11-09 15:52:40 +01:00
dependabot[bot] 86834eb3c3
Bump actions/checkout from 2 to 4 (#67)
Bumps [actions/checkout](https://github.com/actions/checkout) from 2 to 4.
- [Release notes](https://github.com/actions/checkout/releases)
- [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md)
- [Commits](https://github.com/actions/checkout/compare/v2...v4)

---
updated-dependencies:
- dependency-name: actions/checkout
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-11-09 15:12:49 +01:00
Andrea Spadaccini 66139bc67c
chore: set up dependabot (#65) 2023-11-09 14:59:01 +01:00
Andrea Spadaccini 0722c8f9b2
test: add test for PowerShell 7.2 (#64) 2023-11-09 14:21:27 +01:00
microsoft-github-policy-service[bot] 676b539d61
Adding Microsoft SECURITY.MD (#62)
Microsoft mandatory file

Co-authored-by: microsoft-github-policy-service[bot] <77245923+microsoft-github-policy-service[bot]@users.noreply.github.com>
2023-06-05 14:27:08 +02:00
Andrea Spadaccini da5dd18ce7
Update the nuspec for 2.1.0 and readme (#60) 2023-05-12 10:59:22 +02:00
Andrea Spadaccini 2f5550fee6
Bump version up to 2.1.1 (#59) 2023-05-12 10:32:23 +02:00
Andrea Spadaccini bc7b139c4f
Add CmdletBinding attribute to all cmdlets (#55)
This will allow, among other things, propagation of the ErrorAction
parameter, and correctly inhibit output when needed.

This behavior is tested in a new test for Get-FeatureFlagConfigFromFile.

Fixes Lack of CmdletBinding prevents ErrorAction from propagating #53
2023-05-11 08:09:54 +02:00
Andrea Spadaccini 21a73d8af4
Add codespace config (#54)
This sets up codespaces with Powershell support.
2023-05-10 17:44:08 +02:00
dependabot[bot] 64ff1f89cf
Bump NJsonSchema from 9.13.19 to 9.14.1 (#52)
Bumps [NJsonSchema](https://github.com/rsuter/NJsonSchema) from 9.13.19 to 9.14.1.
- [Release notes](https://github.com/rsuter/NJsonSchema/releases)
- [Commits](https://github.com/rsuter/NJsonSchema/commits)

---
updated-dependencies:
- dependency-name: NJsonSchema
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-05-08 10:15:35 +02:00
dependabot[bot] 52fa78ba3a
Bump Newtonsoft.json from 13.0.2 to 13.0.3 (#50)
Bumps [Newtonsoft.json](https://github.com/JamesNK/Newtonsoft.Json) from 13.0.2 to 13.0.3.
- [Release notes](https://github.com/JamesNK/Newtonsoft.Json/releases)
- [Commits](https://github.com/JamesNK/Newtonsoft.Json/compare/13.0.2...13.0.3)

---
updated-dependencies:
- dependency-name: Newtonsoft.json
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-03-10 14:48:22 +01:00
dependabot[bot] 74a4794068
Bump Newtonsoft.json from 13.0.1 to 13.0.2 (#49)
Bumps [Newtonsoft.json](https://github.com/JamesNK/Newtonsoft.Json) from 13.0.1 to 13.0.2.
- [Release notes](https://github.com/JamesNK/Newtonsoft.Json/releases)
- [Commits](https://github.com/JamesNK/Newtonsoft.Json/compare/13.0.1...13.0.2)

---
updated-dependencies:
- dependency-name: Newtonsoft.json
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-11-24 12:09:37 +01:00
Andrea Spadaccini a79457c925
release: 2.1.0 (#45) 2022-07-08 15:49:58 +02:00
Andrea Spadaccini 631b9dfee0
fix: pin Pester to 4.10.1 for compatibility with pwsh 6.0.4 (#44)
* fix: pin Pester to 4.10.1

This makes tests work under PowerShell 6.0.4.

Also, import the FeatureFlags module first in run-tests.ps1, so that any failures in importing the module are detected early.

* fix: remove BeforeAll/AfterAll

They don't seem to work well with Pester 4.10.1.
2022-07-08 14:11:42 +02:00
Andrea Spadaccini 0a5aa0a027
feat: use built-in Newtonsoft.Json if possible (#43)
If PowerShell ships with a version of Newtonsoft.Json, use it through an assembly binding.
If not, try to load the one we ship with the library.

This will reduce the likelihood of conflicts at assembly loading time, and makes the library
work under Powershell 6.0.x. Fixes #36.

Also, stop whenever there is an error importing the module, to make
debugging easier.
2022-07-08 14:03:29 +02:00
Andrea Spadaccini cc8cab17b2
fix: make Docker tests fail properly (#42)
fix: make tests fail properly

* terminate run-tests.ps1 on the first error;
* split restore and test commands in Dockerfile.
2022-07-07 21:42:35 +02:00
Andrea Spadaccini 87a3a85669
feat: run docker tests against multiple versions (#41) 2022-07-07 18:12:12 +02:00
Andrea Spadaccini c6a57d3cdd
feat: initial workflow for docker-based tests (#40) 2022-07-07 17:55:47 +02:00
Andrea Spadaccini b67eaff1cd
feat: use Test-Json whenever possible (#39)
This will remove the dependency from external assemblies in
PowerShell >= 6.1.0, and therefore increase compatibility by
removing the possibility of assembly conflicts or assembly loading
errors.
2022-07-07 16:31:31 +02:00
Andrea Spadaccini c0322b0a53
feat(test): improve test Dockerfile (#38)
Install cURL if needed, and use a multi-stage build to have a cleaner image.
2022-07-07 15:02:48 +02:00
Andrea Spadaccini da348aa657
feat(test): docker image and small improvements (#37)
* add a Docker image to be used to test with multiple pwsh versions;
* improve run-tests.ps1 output;
* remove unnecessary run-tests.ps1 parameter.
2022-07-07 13:58:38 +02:00
Andrea Spadaccini 2a06383aa6
feat: set up dependabot for all dependencies (#34)
* feat: set up dependabot for all dependencies

* tweak: remove comments
2022-07-06 15:25:55 +02:00
dependabot[bot] 4154e90fc6
Bump Newtonsoft.json from 9.0.1 to 13.0.1 (#30)
* Bump Newtonsoft.json from 9.0.1 to 13.0.1

Bumps [Newtonsoft.json](https://github.com/JamesNK/Newtonsoft.Json) from 9.0.1 to 13.0.1.
- [Release notes](https://github.com/JamesNK/Newtonsoft.Json/releases)
- [Commits](https://github.com/JamesNK/Newtonsoft.Json/compare/9.0.1...13.0.1)

---
updated-dependencies:
- dependency-name: Newtonsoft.json
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>

* fix: add assembly redirect for Newtonsoft.Json

NJsonSchema depends on Newtonsoft.Json 9.x, which we are upgrading
to 13. Adding an assembly resolver so that the NJsonSchema library
references the updated Newtonsoft.Json assembly.

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Andrea Spadaccini <andrea.spadaccini@microsoft.com>
Co-authored-by: Andrea Spadaccini <andreas@microsoft.com>
2022-07-05 12:42:46 +02:00
Andrea Spadaccini dc2910031d
Update schema: public address, no schema version (#33)
* change the address to be the public one rather than a private Azure DevOps repo;
* remove the schema version, because the JSON Schema library I'm targeting for the next upgrade fails to parse the schema if I specify the version.
2022-07-05 11:18:37 +02:00
Andrea Spadaccini 5f8fa49420
feat: only run on Pester 5.3.3 (#32)
* feat: only run on Pester 5.3.3

* fix: skip publisher check when installing Pester

This is a legitimate skip, as the publisher between major Pester versions may
change.

* feat: ignore coverage results
2022-07-04 15:46:52 +02:00
Andrea Spadaccini e08908d5a0
fix(doc): update featureflags.io link (#29)
* fix(doc): update featureflags.io link

* add semicolon to trigger CI
2022-07-04 14:16:12 +02:00
Andrea Spadaccini a9752b486c
Add PowerShell Analyzer GH Action (#31)
* Add PowerShell Analyzer GH Action

* tweak: remove top comment
2022-07-04 14:12:14 +02:00
Andrea Spadaccini a88b40aac3
feat: migrate CI to Github Actions (#27)
Migrate CI from Azure Pipelines to GitHub Actions, point it to the main branch.
2020-12-25 23:15:44 +00:00
Andrea Spadaccini 0742b2035b
Blacklist → denylist, whitelist → allowlist (#20)
Since this is an incompatible change, also bump up version to 2.0.0
(major version change, to signal incompatible API).
2020-06-12 13:39:17 +01:00
Andrea Spadaccini 1a2e1f3261
Fix version number in psd1 file (#25) 2020-06-11 22:32:25 +01:00
Andrea Spadaccini e7b30d33f0
Bump version up to 1.0.1 (#24) 2020-06-11 21:28:50 +01:00
Andrea Spadaccini dd2bc4193d
Improve CI setup (#23)
* Use latest ADO images
* Run CI builds daily, to detect failures more quickly
2020-06-11 18:49:34 +01:00
Andrea Spadaccini 3885c7ab62 Reflect previous code change in log message 2020-06-11 18:37:21 +01:00
Andrea Spadaccini d5d7be0ce9 Fix bug in probability check (> → ≥)
There is a 1/100 chance that a probability check with probability 0
would give the wrong result, because if the random number is 0 the old
code would check if 0 > 0, which is of course false.

Change the test to ≥ to account for this corner case.

Fixes #18.
2020-06-11 18:37:21 +01:00
Andrea Spadaccini 203fa19e22 Fall back to JsonSchema4 if JsonSchema is unavailable
For some reason, it looks like the NJsonSchema library exports a
NJsonSchema object if queried from .NET Core, but if queried
from .NET Framework (Windows PowerShell) it exports a
NJsonSchema4 object. From the same DLL.

This is a workaround to fallback to NJsonSchema4 if NJsonSchema
doesn't seem available, which makes the library work for
Windows PowerShell.
2020-06-11 18:37:21 +01:00
Andrea Spadaccini c4567e4946 Fail tests if the module cannot be imported 2020-06-11 18:37:21 +01:00
Andrea Spadaccini 80b09bfd6a Add some debugging info to module loading 2020-06-11 18:37:21 +01:00
Andrea Spadaccini d6dfbb4b47 Pin Pester version to 4.x
Something changed in Pester 5 and this is causing issues in CI.
2020-06-11 18:37:21 +01:00
Andrea Spadaccini 3fd4ee6a3c Use a current macOS image for Azure Pipelines 2020-06-11 18:37:21 +01:00
Andrea Spadaccini 9466757dfc Fix JSON schema class name
I don't understand how this used to work.

I assume the library broke backwards compatibility at some point.
2020-06-11 18:37:21 +01:00
Andrea Spadaccini 669ec8df07 Fix shields links in README 2019-08-08 16:57:26 +01:00
Andrea Spadaccini 2123e60cab Add NuGet shield to README 2019-08-08 16:09:38 +01:00
Andrea Spadaccini 81efe8dd3b Use a different package name, fix LICENSE
Looks like the PowerShell prefix is reserved in NuGet, so renaming the
package to FeatureFlags.PowerShell in NuGet.

Also fixing the license specification to use the new syntax.
2019-08-08 16:09:38 +01:00
Andrea Spadaccini 570b7bc0b2 Add a NuGet package specification
Work towards resolving #13.
2019-08-08 16:09:38 +01:00
Andrea Spadaccini ff3114f64b Ignore nuget.exe 2019-08-08 16:09:38 +01:00
Andrea Spadaccini 93344579dc Update authors in psd1 2019-08-08 16:09:38 +01:00
Andrea Spadaccini 2bbef362a5 Azure Pipelines: upload test results
Fixes #9.
2019-08-02 16:39:16 +01:00