Commit Graph

28 Commits

Author SHA1 Message Date
Oisin Grehan 6b038d067c
migrate to central package management (#303)
* migrate to CPM

Signed-off-by: Oisin Grehan <oisin.grehan@ionodes.com>
2024-08-13 15:18:34 +01:00
Jon Skeet 4463f8e1ea Update dependencies
Many of these are just build/test/packaging, but customer-relevant dependency updates are:

- AMQPNetLite and AMQPNetLite.Serialization: 2.4.2 => 2.4.11
- System.Text.Encodings.Web: 6.0.0 => 8.0.0 (only used in netstandard2.0 and netstandard2.1 targets)
- Apache.Avro: 1.11.1 => 1.11.3
- Newtonsoft.Json: 13.0.2 => 13.0.3
- Google.Protobuf: 3.22.0 => 3.27.3
- Confluent.Kafka: 1.6.3 => 1.9.3 (see #297 for consideration of a bump to 2.x)

Signed-off-by: Jon Skeet <jonskeet@google.com>
2024-08-02 18:10:45 +01:00
Safia Abdalla 3b78a265f5
Update ASP.NET Core sample to use minimal host (#283)
* Update ASP.NET Core sample to use minimal host

Signed-off-by: Safia Abdalla <safia@safia.rocks>
2024-03-06 18:58:15 +00:00
Jon Skeet 295c12445e chore: Fix editorconfig-based warnings
(It can be hard to get these to show up without opening the code
file itself. I've opened all files within VS, so we *should* be
"clean" now.)

Signed-off-by: Jon Skeet <jonskeet@google.com>
2023-11-14 12:59:42 +00:00
Jon Skeet ae75b32c28 chore: Fix whitespace in all files
These changes were generated automatically by running "Analyze and Code Cleanup".

Showing a diff ignoring whitespace shows the removal of the UTF-8 BOM from three files, but that's all.

Signed-off-by: Jon Skeet <jonskeet@google.com>
2023-11-14 12:20:57 +00:00
Jon Skeet 8999fce15f Update core dependencies
This also removes testing on .NET Core 3.1, which is out of support.

Signed-off-by: Jon Skeet <jonskeet@google.com>
2023-03-06 19:51:46 +00:00
Jon Skeet ee9d91a398 chore: Tweaks to the sample HttpSend code
In particular, this now generates a random event ID - v1.x used to
do this automatically, but in 2.x it needs to be explicit.

Signed-off-by: Jon Skeet <jonskeet@google.com>
2022-06-27 15:53:31 +01:00
Jon Skeet 4f13307d66 Update to .NET 6 SDK to build and netcoreapp3.1 for test
This requires a few nullable-reference-type overrides in tests where
we're absolutely confident they won't be null (and if we're wrong,
an NRE is fine to break the test).

Signed-off-by: Jon Skeet <jonskeet@google.com>
2022-01-12 07:09:02 +00:00
Jon Skeet 19afd42806 Improve the ASP.NET Core sample
- Test with both ASP.NET Core 3.1 and 5.0
- Add an API method to generate an event
- Change the launch settings to launch directly instead of with IIS Express

If #153 is merged before this, we'll need to modify it very slightly
as the encoding method will return `ReadOnlyMemory<byte>` instead of
`byte[]`, but that's easy enough to do.

Signed-off-by: Jon Skeet <jonskeet@google.com>
2021-06-07 09:02:05 +01:00
Jon Skeet f7eb74624a Remove CloudEventJsonInputFormatter from the ASP.NET Core package
This commit moves it to the sample directory for now. There are
elements we'll want to look at more closely before including it
directly in the package, but anyone can easily look at the code and
include it themselves for now, if it suits their needs.

Means that #75 doesn't block the v2 release.

Signed-off-by: Jon Skeet <jonskeet@google.com>
2021-06-03 18:13:26 +01:00
Jon Skeet 5910e8b34a Update all dependencies
Note that the ASP.NET Core dependencies are slightly complicated - see #142.

I'm also *somewhat* alarmed by the release notes of MQTTnet, which contain a lot of breaking changes within patch versions...

Signed-off-by: Jon Skeet <jonskeet@google.com>
2021-05-21 20:20:29 +01:00
Jon Skeet 71003be892 First pass at new documentation for 2.0.0-beta.2 onwards
This is definitely a bare minimum, and we'd want more samples etc -
but it's probably enough to release 2.0.0-beta.2 and build up from
there.

Fixes #98.

Fixes #74.

Fixes #55.

Signed-off-by: Jon Skeet <jonskeet@google.com>
2021-05-05 08:27:25 +01:00
Jon Skeet 8e56fe32b9 Remove unnecessary inheritance for HttpContent
Signed-off-by: Jon Skeet <jonskeet@google.com>
2021-03-01 08:56:48 +00:00
Jon Skeet 8b63348296 feat: Extract the existing JSON event formatter from the main SDK
This allows us to remove the Newtonsoft.Json dependency from the
SDK, and implement another event formatter based on System.Text.Json
later on. That should probably wait until we've iterated on the
design of event formatters though.

This commit moves us closer towards (but doesn't fix) #42.

Signed-off-by: Jon Skeet <jonskeet@google.com>
2021-02-13 06:42:43 +00:00
Jon Skeet 70b5ae99fd Overhaul of codebase with new approach to attributes
This touches almost file in the repository, because it's hard not to
with such a fundamental change.

There are *lots* of TODOs now, all of which we should chase down
before release. In most cases this isn't a new problem - it's just
one that wasn't noted before,

The two main changes are:

- Spec versions, attributes, and attributes types are now first-class
  types. Rather than being able to set attributes to any value you
  want, values have to be of the right type and have a valid value
  (e.g. for datacontenttype). This centralizes value conversion
  for the most part (although transport/format-specific conversions
  may still be required) and makes everything more predictable.
- Extensions are now *not* first-class types; instead, the extension
  attributes can be registered with the CloudEvent in order to perform
  appropriate validation etc, and a pattern around extensions
  providing extension methods on CloudEvent allows them to be used
  easily.

This work has revealed a lot of smaller problems, such as the HTTP
transports propagating a content of "null" (rather than no content)
when no data was set in the CloudEvent. More testing is certainly
required.

It's worth noting that this is a really big breaking change. The 2.0
release was already going to be breaking, but this is much larger
than the previous changes. I assert that the benefits outweight the
costs though, and even though the package already has many users,
we hope there will be many times more users in the future.

Proposed process for this PR:

- This initial commit does not include nearly as many unit tests for
  CloudEvent, CloudEventAttribute or CloudEventAttributeType as I'd
  like. Those will come in a follow-up commit (which should be
  reviewed before merging) but don't affect the review of the overall
  ideas.
- If the general thrust of this PR is acceptable, then I propose we
  merge it, only making changes to the most egregious problems, and
  leaving further clean-up work (of which there's likely to be a lot)
  to later PRs. It's easier to create a clean-up PR in Visual Studio
  than to suggest fixes via GitHub.

Style changes:

- Use explicit access modifiers
- Move using directives before the namespace declaration
- Unit tests are generally more separated out to correspond to
  production classes, and are in separate directories/namespaces
  by project instead of all at the top level.

Currently StyleCop is not installed, but we should probably either
do that or use regular Roslyn analyzers in the long term - along
with turning on XML documentation generation.

Signed-off-by: Jon Skeet <jonskeet@google.com>
2021-02-11 07:57:38 +00:00
Jon Skeet 7debdc1513 Update netcoreapp3.0 targets to netcoreapp3.1
(3.1 is the LTS release; 3.0 is out of support now.)

Signed-off-by: Jon Skeet <jonskeet@google.com>
2021-01-15 17:34:42 +00:00
Jon Skeet e836d6ce90 Sign test/sample assemblies, and make internals visible to unit tests
Signed-off-by: Jon Skeet <jonskeet@google.com>
2021-01-12 08:55:20 +00:00
Jon Skeet 4e98c5a52b Make all sample and test project non-packable
It's simpler and more reliable to do this with Directory.Build.props files than in individual project files.

Signed-off-by: Jon Skeet <jonskeet@google.com>
2020-11-11 07:38:08 +00:00
Jon Skeet aea34a4f5c Make test and samples directories handle DeterministicSourcePaths
(This is important for CI and release builds.)

Signed-off-by: Jon Skeet <jonskeet@google.com>
2020-07-14 19:05:46 +01:00
clemensv 91ff29512b Documentation fixes
Signed-off-by: clemensv <clemensv@microsoft.com>
2020-01-15 11:12:03 +01:00
Tobias Lønnerød Madsen 1d90e16afc
Extending integration test to also test extension deserialization
Signed-off-by: Tobias Lønnerød Madsen <m@dsen.tv>
2019-11-07 09:08:05 +01:00
Tobias Lønnerød Madsen 340ba9cca9
Renaming CloudEventInputFormatter to CloudEventJsonInputFormatter
Signed-off-by: Tobias Lønnerød Madsen <m@dsen.tv>
2019-11-07 08:50:12 +01:00
Tobias Lønnerød Madsen aa78505be6
Bumping ASP.Net package to 3.0, implementing async decoding of CloudEvents
Signed-off-by: Tobias Lønnerød Madsen <m@dsen.tv>
2019-11-06 12:12:29 +01:00
Tobias Lønnerød Madsen 86a786949e
Added sample along with some integration tests
Signed-off-by: Tobias Lønnerød Madsen <m@dsen.tv>
2019-10-31 15:26:52 +01:00
Clemens Vasters a2be3fb00e
Merge pull request #11 from friism/clean-code
Clean code
2019-09-17 06:34:14 -07:00
Clemens Vasters f3e6020fe6 added support for version 0.3
Signed-off-by: Clemens Vasters <clemensv@microsoft.com>
2019-05-19 22:39:34 +02:00
Michael Friis edb1ea8281 remove unused using
Signed-off-by: Michael Friis <friism@gmail.com>
2019-02-26 17:07:28 -08:00
clemensv a650ad5323 More test/doc coverage, send sample
Signed-off-by: clemensv <clemensv@microsoft.com>
2018-11-26 12:47:56 +01:00