From 92d0e5efc10f7b52a9560f719fdfc4104b4e2843 Mon Sep 17 00:00:00 2001 From: Dan Benitah <8134789+danuw@users.noreply.github.com> Date: Tue, 12 Nov 2024 08:33:45 +0000 Subject: [PATCH] Release 1.6.1 (#587) * Further updates to clean up merge duplication * Signed-off-by: Vaughan Knight DCO Remediation Commit for Vaughan Knight I, Vaughan Knight , hereby add my Signed-off-by to this commit: da70ec4c4c1118c95826f091ea1aef3a44eba7cc I, Vaughan Knight , hereby add my Signed-off-by to this commit: 6be74ff7ac9da77bf099be359f4845ad4b3c4680 I, Vaughan Knight , hereby add my Signed-off-by to this commit: fe5cef9fa2e5ebaafb19312e9b47b5a4cc330dc9 I, Vaughan Knight , hereby add my Signed-off-by to this commit: b4a7973a003ef67748336194bbf6032445d96c32 I, Vaughan Knight , hereby add my Signed-off-by to this commit: d0a954ae137c3c7f4c28089da29223f5dc887be0 I, Vaughan Knight , hereby add my Signed-off-by to this commit: 996d0846b4d4e0de5f30c6d6336ee1aee2ee6e09 I, Vaughan Knight , hereby add my Signed-off-by to this commit: 648a1ced3cfd05437ebd67c5f8ed7eece7a22264 I, Vaughan Knight , hereby add my Signed-off-by to this commit: 581267c6286dc4e7ed4973598c6770762cd7ca13 I, Vaughan Knight , hereby add my Signed-off-by to this commit: 3c90f553a1c9c449142706f753c03f6b1d4e4886 I, Vaughan Knight , hereby add my Signed-off-by to this commit: 6c1514e8bfcbae31c492e706561fff2cd9b9bce9 I, Vaughan Knight , hereby add my Signed-off-by to this commit: 05927105f692044270301b069dfb90634fe19343 I, Vaughan Knight , hereby add my Signed-off-by to this commit: c59057c5750ead17ef09087286f83dd0d35e7fb5 I, Vaughan Knight , hereby add my Signed-off-by to this commit: 0cec58fad1ee95bfa6b59e360b791332964e7f5e I, Vaughan Knight , hereby add my Signed-off-by to this commit: 028a179ca0b4bfc0595cfe124fa4acc11c82c677 Signed-off-by: Vaughan Knight * blog posts - unpublished / placeholder posts currently sit in blog_preview sub folder * annoucementBar #416 to include disclaimer as well as CarbonHack link * CarbonHack24 Update to README.md Signed-off-by: Dan Benitah * bold disclaimer / banner message * ensuring samples get deployed as part of the docs too * working directory correction for moving samples in docs deployment workflow * normalisation of the workflow name to others * latest docusaurus updates to check the latest workflow * docusaurus broken links build warning + move all samples folder * Update CONTRIBUTING.md Signed-off-by: Sophie Trinder <144015600+Sophietn@users.noreply.github.com> * Update CONTRIBUTING.md Signed-off-by: Sophie Trinder <144015600+Sophietn@users.noreply.github.com> * Update CHANGELOG.md Signed-off-by: Dan Benitah * Update CHANGELOG.md with first draft release notes for 1.2 Signed-off-by: Dan Benitah * Update CHANGELOG.md Signed-off-by: Dan Benitah * Update CHANGELOG.md Updating release date Signed-off-by: Dan Benitah * Update WattTime registration link Signed-off-by: Phil Huang * Update containerization.md Small typo ("arbon" => "Carbon") Signed-off-by: Richard Jackson * Create adopters.md Signed-off-by: tkuramoto33 <70622977+tkuramoto33@users.noreply.github.com> * Add Vestas. Signed-off-by: tkuramoto33 <70622977+tkuramoto33@users.noreply.github.com> * Remove a hyphen for consistent appearance Signed-off-by: tkuramoto33 <70622977+tkuramoto33@users.noreply.github.com> * Update the description Signed-off-by: tkuramoto33 <70622977+tkuramoto33@users.noreply.github.com> * Update the description to mention pull requests Signed-off-by: tkuramoto33 <70622977+tkuramoto33@users.noreply.github.com> * Create enablement.md table of content Signed-off-by: Rintaro Ikeda <51394766+rinikeda@users.noreply.github.com> * draft of enablement.md Signed-off-by: Rintaro Ikeda <51394766+rinikeda@users.noreply.github.com> * Update carbon-aware-cli.md Fixes bugs with Linux scripts Signed-off-by: JasonLuuk <96975358+JasonLuuk@users.noreply.github.com> * Initial codespace branch and associated docs * updated vs code extensions * DCO Remediation Commit for Dan Benitah I, Dan Benitah , hereby add my Signed-off-by to this commit: 44578f400c37eb20a81663f1b769308f7c511859 I, Dan Benitah , hereby add my Signed-off-by to this commit: 3ae9a001dafb9584b929bc2746a143c1a58a36ec Signed-off-by: Dan Benitah * Update README.md * More updates More updates * Added plcaeholder images Added plcaeholder images * Updated images Updates all images and compressed some images, cleaned up naming for the avif file. * More updates New images, and some updates to the copy after stepping away from it for a bit. * Updates with theory of change details Updates with theory of change details * Minor updates, included adopters page link Minor updates, included adopters page link * Update README.md * More updates More updates * Added plcaeholder images Added plcaeholder images * Updated images Updates all images and compressed some images, cleaned up naming for the avif file. * More updates New images, and some updates to the copy after stepping away from it for a bit. * Updates with theory of change details Updates with theory of change details * Signed-off-by: Vaughan Knight DCO Remediation Commit for Vaughan Knight I, Vaughan Knight , hereby add my Signed-off-by to this commit: da70ec4c4c1118c95826f091ea1aef3a44eba7cc I, Vaughan Knight , hereby add my Signed-off-by to this commit: 6be74ff7ac9da77bf099be359f4845ad4b3c4680 I, Vaughan Knight , hereby add my Signed-off-by to this commit: fe5cef9fa2e5ebaafb19312e9b47b5a4cc330dc9 I, Vaughan Knight , hereby add my Signed-off-by to this commit: b4a7973a003ef67748336194bbf6032445d96c32 I, Vaughan Knight , hereby add my Signed-off-by to this commit: d0a954ae137c3c7f4c28089da29223f5dc887be0 I, Vaughan Knight , hereby add my Signed-off-by to this commit: 996d0846b4d4e0de5f30c6d6336ee1aee2ee6e09 I, Vaughan Knight , hereby add my Signed-off-by to this commit: 648a1ced3cfd05437ebd67c5f8ed7eece7a22264 I, Vaughan Knight , hereby add my Signed-off-by to this commit: 581267c6286dc4e7ed4973598c6770762cd7ca13 I, Vaughan Knight , hereby add my Signed-off-by to this commit: 3c90f553a1c9c449142706f753c03f6b1d4e4886 I, Vaughan Knight , hereby add my Signed-off-by to this commit: 6c1514e8bfcbae31c492e706561fff2cd9b9bce9 I, Vaughan Knight , hereby add my Signed-off-by to this commit: 05927105f692044270301b069dfb90634fe19343 I, Vaughan Knight , hereby add my Signed-off-by to this commit: c59057c5750ead17ef09087286f83dd0d35e7fb5 I, Vaughan Knight , hereby add my Signed-off-by to this commit: 0cec58fad1ee95bfa6b59e360b791332964e7f5e I, Vaughan Knight , hereby add my Signed-off-by to this commit: 028a179ca0b4bfc0595cfe124fa4acc11c82c677 Signed-off-by: Vaughan Knight * Update tests.md our current coverage is 74.6% so adjusting until we can improve Signed-off-by: Dan Benitah * Update README.md linking to the new banner Signed-off-by: Dan Benitah * adding the banner image Signed-off-by: Dan Benitah * Create SECURITY.md * merge and bug fixes * Qucikstart fix and overview link adjustment following move * Up Helm chart version to 1.1.0 Signed-off-by: Yasumasa Suenaga * Signed-off-by: Vaughan Knight DCO Remediation Commit for Vaughan Knight I, Vaughan Knight , hereby add my Signed-off-by to this commit: da70ec4c4c1118c95826f091ea1aef3a44eba7cc I, Vaughan Knight , hereby add my Signed-off-by to this commit: 6be74ff7ac9da77bf099be359f4845ad4b3c4680 I, Vaughan Knight , hereby add my Signed-off-by to this commit: fe5cef9fa2e5ebaafb19312e9b47b5a4cc330dc9 I, Vaughan Knight , hereby add my Signed-off-by to this commit: b4a7973a003ef67748336194bbf6032445d96c32 I, Vaughan Knight , hereby add my Signed-off-by to this commit: d0a954ae137c3c7f4c28089da29223f5dc887be0 I, Vaughan Knight , hereby add my Signed-off-by to this commit: 996d0846b4d4e0de5f30c6d6336ee1aee2ee6e09 I, Vaughan Knight , hereby add my Signed-off-by to this commit: 648a1ced3cfd05437ebd67c5f8ed7eece7a22264 I, Vaughan Knight , hereby add my Signed-off-by to this commit: 581267c6286dc4e7ed4973598c6770762cd7ca13 I, Vaughan Knight , hereby add my Signed-off-by to this commit: 3c90f553a1c9c449142706f753c03f6b1d4e4886 I, Vaughan Knight , hereby add my Signed-off-by to this commit: 6c1514e8bfcbae31c492e706561fff2cd9b9bce9 I, Vaughan Knight , hereby add my Signed-off-by to this commit: 05927105f692044270301b069dfb90634fe19343 I, Vaughan Knight , hereby add my Signed-off-by to this commit: c59057c5750ead17ef09087286f83dd0d35e7fb5 I, Vaughan Knight , hereby add my Signed-off-by to this commit: 0cec58fad1ee95bfa6b59e360b791332964e7f5e I, Vaughan Knight , hereby add my Signed-off-by to this commit: 028a179ca0b4bfc0595cfe124fa4acc11c82c677 Signed-off-by: Vaughan Knight * CarbonHack24 Update to README.md Signed-off-by: Dan Benitah * Create tests.md test coverage #413 Signed-off-by: Dan Benitah * Update tests.md our current coverage is 74.6% so adjusting until we can improve Signed-off-by: Dan Benitah * Signed-off-by: Vaughan Knight DCO Remediation Commit for Vaughan Knight I, Vaughan Knight , hereby add my Signed-off-by to this commit: da70ec4c4c1118c95826f091ea1aef3a44eba7cc I, Vaughan Knight , hereby add my Signed-off-by to this commit: 6be74ff7ac9da77bf099be359f4845ad4b3c4680 I, Vaughan Knight , hereby add my Signed-off-by to this commit: fe5cef9fa2e5ebaafb19312e9b47b5a4cc330dc9 I, Vaughan Knight , hereby add my Signed-off-by to this commit: b4a7973a003ef67748336194bbf6032445d96c32 I, Vaughan Knight , hereby add my Signed-off-by to this commit: d0a954ae137c3c7f4c28089da29223f5dc887be0 I, Vaughan Knight , hereby add my Signed-off-by to this commit: 996d0846b4d4e0de5f30c6d6336ee1aee2ee6e09 I, Vaughan Knight , hereby add my Signed-off-by to this commit: 648a1ced3cfd05437ebd67c5f8ed7eece7a22264 I, Vaughan Knight , hereby add my Signed-off-by to this commit: 581267c6286dc4e7ed4973598c6770762cd7ca13 I, Vaughan Knight , hereby add my Signed-off-by to this commit: 3c90f553a1c9c449142706f753c03f6b1d4e4886 I, Vaughan Knight , hereby add my Signed-off-by to this commit: 6c1514e8bfcbae31c492e706561fff2cd9b9bce9 I, Vaughan Knight , hereby add my Signed-off-by to this commit: 05927105f692044270301b069dfb90634fe19343 I, Vaughan Knight , hereby add my Signed-off-by to this commit: c59057c5750ead17ef09087286f83dd0d35e7fb5 I, Vaughan Knight , hereby add my Signed-off-by to this commit: 0cec58fad1ee95bfa6b59e360b791332964e7f5e I, Vaughan Knight , hereby add my Signed-off-by to this commit: 028a179ca0b4bfc0595cfe124fa4acc11c82c677 Signed-off-by: Vaughan Knight * blog updates * DCO Remediation Commit for Dan Benitah I, Dan Benitah , hereby add my Signed-off-by to this commit: 356ce0931b313eeab62d705371564ed9e8efca03 I, Dan Benitah , hereby add my Signed-off-by to this commit: 2c342a85a0c8b549b021135d6e026963bee7bbb5 I, Dan Benitah , hereby add my Signed-off-by to this commit: 04be596f3d35a8d87676a08fe9c6de6f75a75434 I, Dan Benitah , hereby add my Signed-off-by to this commit: c437b5bc23992593b081b1c742be3ec89a956f7d I, Dan Benitah , hereby add my Signed-off-by to this commit: 46958d9db7c2f5228af8695b9448ea50eaab129d I, Dan Benitah , hereby add my Signed-off-by to this commit: 21a0e16bfa1420f55fc9456a28ffc71aca39a0bb I, Dan Benitah , hereby add my Signed-off-by to this commit: 8bbe72e49b5c35ad7c8612d3d1bc417d59b2ef04 I, Dan Benitah , hereby add my Signed-off-by to this commit: 62e2a9591ebf53dd64f1d50c5e28f60c8fc486b7 I, Dan Benitah , hereby add my Signed-off-by to this commit: 5183d734eb62f6b637c711ddbe10d0207f30c945 I, Dan Benitah , hereby add my Signed-off-by to this commit: 93267d60d633e7fd4f7d9545685e970d0e272a50 I, Dan Benitah , hereby add my Signed-off-by to this commit: ee8841cf9d431e5d54fc0d15e73debd1006f184b I, Dan Benitah , hereby add my Signed-off-by to this commit: 2d7b4ddfc914923b019ac3d51b34300974fef91c I, Dan Benitah , hereby add my Signed-off-by to this commit: 68bbb2fbbf44853a4faec59d7c4898b1b6690a1d I, Dan Benitah , hereby add my Signed-off-by to this commit: 735a515a28f056fe32a5acd45997703a4169c894 I, Dan Benitah , hereby add my Signed-off-by to this commit: a31b3916da5fc7031022352c28477e1f5cb98ae8 I, Dan Benitah , hereby add my Signed-off-by to this commit: b7483b63e72e0b57eda0e0f3f901e23d515ab0c9 I, Dan Benitah , hereby add my Signed-off-by to this commit: 4cece7bbd2aa7a1fc3063d0b3e202ab032afc438 I, Dan Benitah , hereby add my Signed-off-by to this commit: 83f3073e4ba13f4fd13c4fec91a6af3f72f5e2fb I, Dan Benitah , hereby add my Signed-off-by to this commit: 4799d7a2f7aaa23056ecfc1902147e2bb2d0f2c4 I, Dan Benitah , hereby add my Signed-off-by to this commit: d2d823d39f018aad82f9a087c2e3a1be1838ca94 I, Dan Benitah , hereby add my Signed-off-by to this commit: c3d832c9c628bcfcd0eb9e0b3f42abac6b638d55 I, Dan Benitah , hereby add my Signed-off-by to this commit: ec96b524f37c7ff7716ec7f252146fc6ef0060d0 I, Dan Benitah , hereby add my Signed-off-by to this commit: 9567c45a54986746b562969936fadd562c387a2d I, Dan Benitah , hereby add my Signed-off-by to this commit: 45275148c63345b851be224630c170304f693226 I, Dan Benitah , hereby add my Signed-off-by to this commit: ff729b0542fe356419bf25625e7d60f8b1f7d9f7 I, Dan Benitah , hereby add my Signed-off-by to this commit: 1bdd2add3864d1aade424fa71de4ed5e4e44174a I, Dan Benitah , hereby add my Signed-off-by to this commit: 012ca2506822288b1728a88134659641654ee4ff I, Dan Benitah , hereby add my Signed-off-by to this commit: c7d45630ed0585be8672efd680b260b12ad83b88 I, Dan Benitah , hereby add my Signed-off-by to this commit: a51782f1327c1f09024211d0d289379a05ada224 I, Dan Benitah , hereby add my Signed-off-by to this commit: cc15035494ceaea0245aab1384465de9882a07b9 I, Dan Benitah , hereby add my Signed-off-by to this commit: 3c62bd49d58b43b67cd2adb1e9238cb9baacdc54 I, Dan Benitah , hereby add my Signed-off-by to this commit: 590f26299daf99f7531cc532aa54ab392f1103b9 Signed-off-by: Dan Benitah DCO Remediation Commit for danuw I, danuw , hereby add my Signed-off-by to this commit: fbc602cd4dede581ba7abd1cfbe024dd2a9c13c0 I, danuw , hereby add my Signed-off-by to this commit: ac1432f47ba1c8e949389d18cf491397aa9f051d I, danuw , hereby add my Signed-off-by to this commit: 8166cf283f80e7a63400b0626cc3408d639f9d25 I, danuw , hereby add my Signed-off-by to this commit: 48f117e7e9edc3f82be2e75418666c500d7994ac Signed-off-by: danuw * DCO Remediation Commit for danuw I, danuw , hereby add my Signed-off-by to this commit: fbc602cd4dede581ba7abd1cfbe024dd2a9c13c0 I, danuw , hereby add my Signed-off-by to this commit: ac1432f47ba1c8e949389d18cf491397aa9f051d I, danuw , hereby add my Signed-off-by to this commit: 8166cf283f80e7a63400b0626cc3408d639f9d25 I, danuw , hereby add my Signed-off-by to this commit: 48f117e7e9edc3f82be2e75418666c500d7994ac Signed-off-by: danuw Signed-off-by: Dan Benitah * Update baseURL docusaurus config Signed-off-by: Osama Jandali * Update docusaurus.config.js Signed-off-by: Osama Jandali * Revert changes Signed-off-by: Osama Jandali * Update domain from docusaurus Signed-off-by: Osama Jandali * Update docusaurus.config.js Signed-off-by: Osama Jandali * Create CNAME file Signed-off-by: Osama Jandali * clean up for title * Option to show the samples in the local docs using `nm run start-with-samples` . Will need deleting manually for now * seo for the doc site * docs fixes * layout update for blogs * Update SECURITY.md Updated with @Willmish recommendations for the document which were lost in a comment :+1: * DCO Remediation Commit for Vaughan Knight I, Vaughan Knight , hereby add my Signed-off-by to this commit: 2dc06f82e7bcc66854799f69340299873920df60 Signed-off-by: Vaughan Knight * Ensure pictures on the blog are correctly sized * updated links to videos * Update README.md * Change "Withing" to "Within" I'm genuinely unsure on what word this should be, possible "Using", but I'm sure it's not "Withing". Signed-off-by: Richard Jackson * Update README.md Two other typos - programatically -> programmatically - soruces -> sources Signed-off-by: Richard Jackson * first draft of release 1.3 changelog * Update README.md with updated link to overview Signed-off-by: Dan Benitah * Fix overview URL in README Signed-off-by: Szymon Duchniewicz * Update README.md Update FAQ link for Carbon Hack Signed-off-by: Russell Trow * Updates to the contribution documentation Updates to the contribution documentation * DCO Remediation Commit for Vaughan Knight I, Vaughan Knight , hereby add my Signed-off-by to this commit: f267ebabbffd7529b2fd0c9b09ad55fa79e614cd Signed-off-by: Vaughan Knight * Readme as project overview in docs, disclaimer update for graduated project, and docs deploying pipeline updates * DCO Remediation Commit for Vaughan Knight I, Vaughan Knight , hereby add my Signed-off-by to this commit: bd7ad15181b1d7f3c3f8c70585deba1df6488f44 I, Vaughan Knight , hereby add my Signed-off-by to this commit: 693beedf79a92800da2182ce977a7dd32f1170d5 I, Vaughan Knight , hereby add my Signed-off-by to this commit: 1d78756b93a9af75d548ce3b556cd76d7470c0d4 I, Vaughan Knight , hereby add my Signed-off-by to this commit: a7bc0fc47f2c1df5525c040d4ac3b54d5fd95b4e I, Vaughan Knight , hereby add my Signed-off-by to this commit: 571e21744493d6945f3c8e86a58be683b4a434a0 I, Vaughan Knight , hereby add my Signed-off-by to this commit: a07870f39713ea18af8079c3f168ced6a2468148 I, Vaughan Knight , hereby add my Signed-off-by to this commit: 0314c47d1eb4c2f8ac9be9b44554c9e248a72feb I, Vaughan Knight , hereby add my Signed-off-by to this commit: 3af6f73c2e5e21c7e67c978c676c58df363ffbe5 I, Vaughan Knight , hereby add my Signed-off-by to this commit: 932a66582e5f5f6696b8b97020ab29d4f4ce107c I, Vaughan Knight , hereby add my Signed-off-by to this commit: 9f09493d9e11905d878792093f17a955ce8c6226 I, Vaughan Knight , hereby add my Signed-off-by to this commit: 02ea4d68c35cd0309ac0bad0f0b7ec26f9d73bc9 I, Vaughan Knight , hereby add my Signed-off-by to this commit: 183a676dae57efbb9d9d575a27fde0acc3000f16 I, Vaughan Knight , hereby add my Signed-off-by to this commit: 0481081ed9f8573fa8612873db7dfc8d2644a104 Signed-off-by: Vaughan Knight * Migrate to .NET 8 https://github.com/Green-Software-Foundation/carbon-aware-sdk/pull/404 https://github.com/Green-Software-Foundation/carbon-aware-sdk/pull/420 https://github.com/Green-Software-Foundation/carbon-aware-sdk/pull/421 https://github.com/Green-Software-Foundation/carbon-aware-sdk/pull/422 Co-authored-by: Takuya Iwatsuka Signed-off-by: Yasumasa Suenaga * fix typos Signed-off-by: omahs <73983677+omahs@users.noreply.github.com> * fix typo Signed-off-by: omahs <73983677+omahs@users.noreply.github.com> * fix typo Signed-off-by: omahs <73983677+omahs@users.noreply.github.com> * fix typos Signed-off-by: omahs <73983677+omahs@users.noreply.github.com> * fix typos Signed-off-by: omahs <73983677+omahs@users.noreply.github.com> * fix typos Signed-off-by: omahs <73983677+omahs@users.noreply.github.com> * Update agenda-template.md Signed-off-by: Sophie Trinder <144015600+Sophietn@users.noreply.github.com> * Resolve NU1605 relating to System.IO.FileSystem.Primitives https://learn.microsoft.com/en-us/nuget/reference/errors-and-warnings/nu1605#example-3 Signed-off-by: Yasumasa Suenaga * Use RID rather than QEMU to build WebAPI container image https://devblogs.microsoft.com/dotnet/improving-multiplatform-container-support/ Signed-off-by: Yasumasa Suenaga * Separate OpenAPI document generation from build-env stage Signed-off-by: Yasumasa Suenaga * Create case-study-template.md Creating the case study template. Signed-off-by: Vaughan Knight * Update case-study-template.md Minor updates. Signed-off-by: Vaughan Knight * Up Helm chart version to 1.2.0 (#500) Signed-off-by: Yasumasa Suenaga * First draft of the ADR for watt time v3 changes First draft of the ADR for watt time v3 changes. Looking at path mappings and parameters. Still plenty to work on. * Initial changelog 1.4.0 (#511) Signed-off-by: Dan Benitah * overview.md: Fixed three broken links Signed-off-by: joecus1 * DCO Remediation Commit for joecus1 I, joecus1 , hereby add my Signed-off-by to this commit: c6b2c14a660e868a5d36bff6fef31aab2cbc826f Signed-off-by: joecus1 * Update enablement.md update older .Net reference Signed-off-by: nttDamien <125525959+nttDamien@users.noreply.github.com> * (fix) broken links - Update enablement.md Signed-off-by: nttDamien <125525959+nttDamien@users.noreply.github.com> * Moved ADR to correct location Moved ADR to correct location * Further updates for the watt time v2 to v3 upgrade Signed-off-by: Vaughan Knight * Further updates for the watt time v2 to v3 upgrade Signed-off-by: Vaughan Knight * Update SECURITY.md (.NET 8 upgrade) Signed-off-by: nttDamien <125525959+nttDamien@users.noreply.github.com> * Update enablement.md 2 missed references... Signed-off-by: nttDamien <125525959+nttDamien@users.noreply.github.com> * Update docusaurus.config.js removed banner's mention of Hack Signed-off-by: Dan Benitah * Update docusaurus.config.js Signed-off-by: Dan Benitah * documentation-change.yml: Created issue template for documentation changes. Signed-off-by: joecus1 * Update 0016-watt-time-v3.md updated notes for BA Signed-off-by: Vaughan Knight * First draft of the ADR for watt time v3 changes First draft of the ADR for watt time v3 changes. Looking at path mappings and parameters. Still plenty to work on. * Moved ADR to correct location Moved ADR to correct location * Further updates for the watt time v2 to v3 upgrade Signed-off-by: Vaughan Knight * Update 0016-watt-time-v3.md updated notes for BA Signed-off-by: Vaughan Knight * Add blog article for .NET 8 upgrade Signed-off-by: Yasumasa Suenaga * Update article Signed-off-by: Yasumasa Suenaga * Create 0016-watt-time-v3.md More updates. * Added base url to the configuration with validation Added AuthenticationBaseUrl to the configuration and updated Authentication to leverage the v3 authenication path - note the API is not updated and will require further updates. * Updated start and end configuration Updated start and end configuration to new values * Balancing Authority Parameter Renamed to Region Balancing Authority Renamed to Region. Does not include updates to API, just the Query String parameter. * Add example for 'podman play kube' (#340) * Add example for 'podman play kube' Signed-off-by: Yasumasa Suenaga * Update Swagger JSON URL Signed-off-by: Yasumasa Suenaga --------- Signed-off-by: Yasumasa Suenaga * Updates for historical data API Updates for historical data API * Removed accidental file Removed accidental file * Lots of test updates Lots of test updates, need to do some fixes. * Historical forecasts updated Historical forecasts updated * DCO Remediation Commit for Vaughan Knight I, Vaughan Knight , hereby add my Signed-off-by to this commit: b9490e425c291b75cc13ecd877a4b34ca96ab68c I, Vaughan Knight , hereby add my Signed-off-by to this commit: b991bac14c9864f331e56b739398b9675f23e37c I, Vaughan Knight , hereby add my Signed-off-by to this commit: e4f14944901e0ebecf4e4a7c8b2c543a87b37a7d I, Vaughan Knight , hereby add my Signed-off-by to this commit: b443e9eaa3cdcedd7cfab435e64f8a9999ca44d8 I, Vaughan Knight , hereby add my Signed-off-by to this commit: ab1205d699f99887e9a7e59f2bf8b0a692690df6 I, Vaughan Knight , hereby add my Signed-off-by to this commit: 7c115fa1213cbc042ffbe6e72f208a190b5d7584 I, Vaughan Knight , hereby add my Signed-off-by to this commit: e047c9a2711ef5aa2e5cb2cbb094fa21914eb8d5 I, Vaughan Knight , hereby add my Signed-off-by to this commit: aa81382704ccec7a8da108ef5c293845a9468c8f I, Vaughan Knight , hereby add my Signed-off-by to this commit: 8640c8cf242b1872701fa46b5ba338d28c09a512 I, Vaughan Knight , hereby add my Signed-off-by to this commit: 880fcf78c1e29342b17086bce6375d31a3dbb224 Signed-off-by: Vaughan Knight * Many tests reworked, a few to go Many tests reworked, a few to go. Consolidated a lot of the hand crafted json objects into objects that get serialized as the purist JsonObject format was prone to errors - in some cases tests were passing even with bad typing. * Further test updates Further test updates * Further updates, just 1 test left to remediate Further updates, just 1 test left to remediate * Updated to add authentication client to the service builder for the tests Updated to add authentication client to the service builder for the tests. All tests now passing. * Renaming of Balancing Authority to Region Renaming of Balancing Authority to Region through all code and comments. This will also need updating through documentation. * Fixed spelling error in latitude Fixed spelling error in latitude * Fixed a bug where location sources were loading twice Fixed a bug where location sources were loading twice. Added a semaphore to stop any threading issues, and also stopped it loading twice in the service configuration. * Fixed typo for method name Fixed typo for method name * DCO Remediation Commit for Vaughan Knight I, Vaughan Knight , hereby add my Signed-off-by to this commit: e324f365a3086830f3ac2d0e5ad4d37112fa5c6a I, Vaughan Knight , hereby add my Signed-off-by to this commit: be6663cba48dba0af2ace3db90519377101d2d4d I, Vaughan Knight , hereby add my Signed-off-by to this commit: 39e45a61b999f862b4b3cc7a6adb430b25dfe08d I, Vaughan Knight , hereby add my Signed-off-by to this commit: fbfcac1558d8990404c0605aad9325e220ab29c5 I, Vaughan Knight , hereby add my Signed-off-by to this commit: 9aabd27438d1d7e21de830314af6658ceaaad789 I, Vaughan Knight , hereby add my Signed-off-by to this commit: 8127a92a28c13e295d6ad618f707c1e817aa92b2 I, Vaughan Knight , hereby add my Signed-off-by to this commit: 4ff0151bd1528a6e00ff565e906d36caed86a0fb I, Vaughan Knight , hereby add my Signed-off-by to this commit: d93320f11fe205fd7d5f18cd559c05185ee84056 I, Vaughan Knight , hereby add my Signed-off-by to this commit: 91799f778b9b544575837b85f3eba27728218e1f I, Vaughan Knight , hereby add my Signed-off-by to this commit: 466581396933362dbb37c9d6f148b720a39c4599 Signed-off-by: Vaughan Knight * Updates based on code review for WattTime Tests Updates based on code review for WattTime Tests. Mostly cleanup of constants which were removed elsewhere in tests. * Cleaned up a lot of the string literals Cleaned up a lot of the string literals. They were causing too much fragility in the code base, and made it complex when updating the WattTime API. * More cleanup of some of the strings More cleanup of some of the strings. Creating consistency for using the test data on parameters and not just reponses also. * Updates to documentation and changelog Updates to documentation and changelog * Fix Signed-off-by: Yasumasa Suenaga * Update azure-regions.json (#536) Latest azure-regions.json list Adds italynorth, polandcentral, spaincentral, mexicocentral, israelcentral, qatarcentral, brazilus, eastusstg (Also seems to remove trailing zeros in some existing coordinates) Signed-off-by: Dan Benitah * Update casdk-docs/blog/2024-05-16-dotnet8/index.md Co-authored-by: Vaughan Knight Signed-off-by: Yasumasa Suenaga * Update casdk-docs/blog/2024-05-16-dotnet8/index.md Co-authored-by: Vaughan Knight Signed-off-by: Yasumasa Suenaga * Update casdk-docs/blog/2024-05-16-dotnet8/index.md Co-authored-by: Vaughan Knight Signed-off-by: Yasumasa Suenaga * Update casdk-docs/blog/2024-05-16-dotnet8/index.md Co-authored-by: Vaughan Knight Signed-off-by: Yasumasa Suenaga * Update casdk-docs/blog/2024-05-16-dotnet8/index.md Co-authored-by: Vaughan Knight Signed-off-by: Yasumasa Suenaga * Update casdk-docs/blog/2024-05-16-dotnet8/index.md Co-authored-by: Vaughan Knight Signed-off-by: Yasumasa Suenaga * Update casdk-docs/blog/2024-05-16-dotnet8/index.md Co-authored-by: Vaughan Knight Signed-off-by: Yasumasa Suenaga * Update casdk-docs/blog/2024-05-16-dotnet8/index.md Co-authored-by: Vaughan Knight Signed-off-by: Yasumasa Suenaga * Update casdk-docs/blog/2024-05-16-dotnet8/index.md Co-authored-by: Vaughan Knight Signed-off-by: Yasumasa Suenaga * Update casdk-docs/blog/2024-05-16-dotnet8/index.md Co-authored-by: Vaughan Knight Signed-off-by: Yasumasa Suenaga * Update casdk-docs/blog/2024-05-16-dotnet8/index.md Co-authored-by: Vaughan Knight Signed-off-by: Yasumasa Suenaga * Update casdk-docs/blog/2024-05-16-dotnet8/index.md Co-authored-by: Vaughan Knight Signed-off-by: Yasumasa Suenaga * Update casdk-docs/blog/2024-05-16-dotnet8/index.md Co-authored-by: Vaughan Knight Signed-off-by: Yasumasa Suenaga * Update casdk-docs/blog/2024-05-16-dotnet8/index.md Co-authored-by: Vaughan Knight Signed-off-by: Yasumasa Suenaga * Update casdk-docs/blog/2024-05-16-dotnet8/index.md Co-authored-by: Vaughan Knight Signed-off-by: Yasumasa Suenaga * Update casdk-docs/blog/2024-05-16-dotnet8/index.md Co-authored-by: Vaughan Knight Signed-off-by: Yasumasa Suenaga * Update casdk-docs/blog/2024-05-16-dotnet8/index.md Co-authored-by: Vaughan Knight Signed-off-by: Yasumasa Suenaga * Update casdk-docs/blog/2024-05-16-dotnet8/index.md Co-authored-by: Vaughan Knight Signed-off-by: Yasumasa Suenaga * Update casdk-docs/blog/2024-05-16-dotnet8/index.md Co-authored-by: Vaughan Knight Signed-off-by: Yasumasa Suenaga * Update casdk-docs/blog/2024-05-16-dotnet8/index.md Co-authored-by: Vaughan Knight Signed-off-by: Yasumasa Suenaga * Update casdk-docs/blog/2024-05-16-dotnet8/index.md Co-authored-by: Vaughan Knight Signed-off-by: Yasumasa Suenaga * Update casdk-docs/blog/2024-05-16-dotnet8/index.md Co-authored-by: Vaughan Knight Signed-off-by: Yasumasa Suenaga * Update casdk-docs/blog/2024-05-16-dotnet8/index.md Co-authored-by: Vaughan Knight Signed-off-by: Yasumasa Suenaga * Update casdk-docs/blog/2024-05-16-dotnet8/index.md Co-authored-by: Vaughan Knight Signed-off-by: Yasumasa Suenaga * Update casdk-docs/blog/2024-05-16-dotnet8/index.md Co-authored-by: Vaughan Knight Signed-off-by: Yasumasa Suenaga * Update casdk-docs/blog/2024-05-16-dotnet8/index.md Co-authored-by: Vaughan Knight Signed-off-by: Yasumasa Suenaga * Update casdk-docs/blog/2024-05-16-dotnet8/index.md Co-authored-by: Vaughan Knight Signed-off-by: Yasumasa Suenaga * Update casdk-docs/blog/2024-05-16-dotnet8/index.md Co-authored-by: Vaughan Knight Signed-off-by: Yasumasa Suenaga * Update casdk-docs/blog/2024-05-16-dotnet8/index.md Co-authored-by: Vaughan Knight Signed-off-by: Yasumasa Suenaga * Update casdk-docs/blog/2024-05-16-dotnet8/index.md Co-authored-by: Vaughan Knight Signed-off-by: Yasumasa Suenaga * Update casdk-docs/blog/2024-05-16-dotnet8/index.md Co-authored-by: Vaughan Knight Signed-off-by: Yasumasa Suenaga * Update casdk-docs/blog/2024-05-16-dotnet8/index.md Co-authored-by: Vaughan Knight Signed-off-by: Yasumasa Suenaga * Fix comments Signed-off-by: Yasumasa Suenaga * Update CHANGELOG.md for v1.5 Signed-off-by: Dan Benitah * Update CHANGELOG.md layout update Signed-off-by: Dan Benitah * Add env directive to values.yaml and troubleshooting guide to avoid inotify limitation on Linux Closes #528 Signed-off-by: Yasumasa Suenaga * Add env directive into explanation of values.yaml for Helm chart Signed-off-by: Yasumasa Suenaga * typo: fix incorrect usage of it's Signed-off-by: Scott Trent * Docs/blog update for releases 1.3 to1.5 and fix (#551) * Catching up on release blog posts for 1.3, 1.4 and 1.5 Signed-off-by: Dan Benitah * fixed docusaurus (strict) compilation error * release dates updated Signed-off-by: Dan Benitah * added tag Signed-off-by: Dan Benitah * tag update to post and image layout fix Signed-off-by: Dan Benitah * updated slug Signed-off-by: Dan Benitah * formatting fix Signed-off-by: Dan Benitah * DCO Remediation Commit for Dan Benitah I, Dan Benitah , hereby add my Signed-off-by to this commit: 53e120ca61b61c9a4c492496969bb5b7eb96ea6f Signed-off-by: Dan Benitah * formatting * DCO Remediation Commit for Dan Benitah I, Dan Benitah , hereby add my Signed-off-by to this commit: 0f6cada09b893ae5c41e9bdea83620ab8af1d81b Signed-off-by: Dan Benitah --------- Signed-off-by: Dan Benitah * Add a configuration for disabling to cache JSON emission data Signed-off-by: Yasumasa Suenaga * Update CHANGELOG.md for 1.6 Signed-off-by: Dan Benitah <8134789+danuw@users.noreply.github.com> * Update 1-pr.yaml Updating from deprecated version of upload and download artifact to v4 as mentioned in https://github.blog/changelog/2024-02-13-deprecation-notice-v1-and-v2-of-the-artifact-actions/ Signed-off-by: Dan Benitah <8134789+danuw@users.noreply.github.com> * Update dev_carbon-aware-api.yml updating upload and download artifact@v1or 2 actions to v4 Signed-off-by: Dan Benitah <8134789+danuw@users.noreply.github.com> * fixes and release notes post for 1.6 Signed-off-by: Dan Benitah * updated blog post * docs workflow's node version updated to latest LTS -> 22 * DCO Remediation Commit for Dan Benitah I, Dan Benitah , hereby add my Signed-off-by to this commit: d3b054b99f0ec5fbf2f27f112d67a1b420921e60 I, Dan Benitah , hereby add my Signed-off-by to this commit: f4125911e2fd84155b4ba5fcd668e676da0a28aa Signed-off-by: Dan Benitah * blogs with truncate Signed-off-by: Dan Benitah * node version update back to 20 Signed-off-by: Dan Benitah * adding yarn.lock * pipelines fixes Signed-off-by: Dan Benitah * Update CarbonAwareController.cs (minor typos) Signed-off-by: Richard Jackson * DCO Remediation Commit for Dan Benitah I, Dan Benitah , hereby add my Signed-off-by to this commit: eae5bd122e00c507d31a1f8d4e3829db5b91c7c4 Signed-off-by: Dan Benitah * Consider null value in carbonIntensity on EM (#575) Issue #571 Signed-off-by: Yasumasa Suenaga * EM datasource didn't filter out-of-range emission data (#572) Issue #570 Signed-off-by: Yasumasa Suenaga * Update CHANGELOG.md updating changelog for 1.6.1 Signed-off-by: Dan Benitah <8134789+danuw@users.noreply.github.com> * Add configuration for tracing log (#531) Signed-off-by: Yasumasa Suenaga * Updating 1.6.1 to include #531 straight away * DCO Remediation Commit for Dan Benitah <8134789+danuw@users.noreply.github.com> I, Dan Benitah <8134789+danuw@users.noreply.github.com>, hereby add my Signed-off-by to this commit: f35bb594282d2437c29932f0a986f087bd34a73c Signed-off-by: Dan Benitah <8134789+danuw@users.noreply.github.com> * fix Signed-off-by: Dan Benitah <8134789+danuw@users.noreply.github.com> --------- Signed-off-by: Vaughan Knight Signed-off-by: Dan Benitah Signed-off-by: Sophie Trinder <144015600+Sophietn@users.noreply.github.com> Signed-off-by: Phil Huang Signed-off-by: Richard Jackson Signed-off-by: tkuramoto33 <70622977+tkuramoto33@users.noreply.github.com> Signed-off-by: Rintaro Ikeda <51394766+rinikeda@users.noreply.github.com> Signed-off-by: JasonLuuk <96975358+JasonLuuk@users.noreply.github.com> Signed-off-by: Yasumasa Suenaga Signed-off-by: danuw Signed-off-by: Osama Jandali Signed-off-by: Szymon Duchniewicz Signed-off-by: Russell Trow Signed-off-by: Yasumasa Suenaga Signed-off-by: omahs <73983677+omahs@users.noreply.github.com> Signed-off-by: joecus1 Signed-off-by: nttDamien <125525959+nttDamien@users.noreply.github.com> Signed-off-by: Yasumasa Suenaga Signed-off-by: Scott Trent Signed-off-by: Dan Benitah <8134789+danuw@users.noreply.github.com> Co-authored-by: Vaughan Knight Co-authored-by: Sophie Trinder <144015600+Sophietn@users.noreply.github.com> Co-authored-by: Phil Huang Co-authored-by: Richard Jackson Co-authored-by: tkuramoto33 <70622977+tkuramoto33@users.noreply.github.com> Co-authored-by: Rintaro Ikeda <51394766+rinikeda@users.noreply.github.com> Co-authored-by: rinikeda Co-authored-by: JasonLuuk <96975358+JasonLuuk@users.noreply.github.com> Co-authored-by: Szymon Duchniewicz Co-authored-by: Yasumasa Suenaga Co-authored-by: Osama Jandali Co-authored-by: Szymon Duchniewicz Co-authored-by: Russell Trow Co-authored-by: Takuya Iwatsuka Co-authored-by: omahs <73983677+omahs@users.noreply.github.com> Co-authored-by: joecus1 Co-authored-by: nttDamien <125525959+nttDamien@users.noreply.github.com> Co-authored-by: Yasumasa Suenaga Co-authored-by: Scott Trent Co-authored-by: Scott Trent <32449003+trent-s@users.noreply.github.com> --- CHANGELOG.md | 15 +++++ .../docs/tutorial-extras/configuration.md | 10 ++++ .../src/ElectricityMapsDataSource.cs | 22 +++---- .../src/Model/HistoryCarbonIntensityData.cs | 4 +- .../test/Client/ElectricityMapsClientTests.cs | 33 ++++++++++ .../test/Client/TestData.cs | 24 ++++++++ .../test/ElectricityMapsDataSourceTests.cs | 22 +++++-- .../ServiceCollectionExtensions.cs | 18 ++++++ src/CarbonAware.WebApi/src/Program.cs | 18 ------ .../ServiceCollectionExtensionsTests.cs | 60 ++++++++++++++++++- .../src/CarbonAwareVariablesConfiguration.cs | 2 + 11 files changed, 189 insertions(+), 39 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 374323c5e..6bf419122 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,21 @@ All notable changes to the Carbon Aware SDK will be documented in this file. +## [1.6.1] - 2024-11 + +Release addressing minor issues [https://github.com/Green-Software-Foundation/carbon-aware-sdk/labels/v1.6.1](https://github.com/Green-Software-Foundation/carbon-aware-sdk/labels/v1.6.1) + +### Added + +- [PR #531] Add configuration for tracing log](https://github.com/Green-Software-Foundation/carbon-aware-sdk/pull/531) + +### Fixed + +- [PR #575] Consider null value in carbonIntensity on EM ](https://github.com/Green-Software-Foundation/carbon-aware-sdk/pull/575) +- [PR #572] EM datasource didn't filter out-of-range emission data ](https://github.com/Green-Software-Foundation/carbon-aware-sdk/pull/572) + +For more details, checkout [https://github.com/Green-Software-Foundation/carbon-aware-sdk/issues/579](https://github.com/Green-Software-Foundation/carbon-aware-sdk/issues/579) + ## [1.6.0] - 2024-09 Release for milestone https://github.com/Green-Software-Foundation/carbon-aware-sdk/milestone/8?closed=1 with general bugs fixes and improvements diff --git a/casdk-docs/docs/tutorial-extras/configuration.md b/casdk-docs/docs/tutorial-extras/configuration.md index e7a12756f..416dce2ed 100644 --- a/casdk-docs/docs/tutorial-extras/configuration.md +++ b/casdk-docs/docs/tutorial-extras/configuration.md @@ -409,6 +409,16 @@ InstrumentationKey. For more details, please refer to AppInsights_InstrumentationKey="AppInsightsInstrumentationKey" ``` +#### Configuring telemetry log + +WebAPI configures [console exporter of OpenTelemetry](https://opentelemetry.io/docs/languages/net/exporters/#console) by default. +You can configure whether the exporter is enabled with `EnableTelemetryLogging`. +Set `false` if you want to reduce the log. + +```bash +CarbonAwareVars__EnableTelemetryLogging=false +``` + ### Prometheus exporter for emissions data > DISCLAIMER: The `/metrics` Prometheus exporter is currently unsupported, and is used for internal GSF needs, and may change in the future. It will retrieve _all_ emissions data and create heavy load on your data API's. It is turned off by default. diff --git a/src/CarbonAware.DataSources/CarbonAware.DataSources.ElectricityMaps/src/ElectricityMapsDataSource.cs b/src/CarbonAware.DataSources/CarbonAware.DataSources.ElectricityMaps/src/ElectricityMapsDataSource.cs index acfc1339e..56bf25b46 100644 --- a/src/CarbonAware.DataSources/CarbonAware.DataSources.ElectricityMaps/src/ElectricityMapsDataSource.cs +++ b/src/CarbonAware.DataSources/CarbonAware.DataSources.ElectricityMaps/src/ElectricityMapsDataSource.cs @@ -138,18 +138,18 @@ private async Task> GetRecentCarbonInstensityData(L private IEnumerable HistoryCarbonIntensityToEmissionsData(Location location, IEnumerable data, DateTimeOffset startTime, DateTimeOffset endTime) { - IEnumerable emissions; var duration = GetDurationFromHistoryDataPointsOrDefault(data, TimeSpan.Zero); - emissions = data.Select(d => - { - var emission = (EmissionsData) d; - emission.Location = location.Name ?? string.Empty; - emission.Time = d.DateTime; - emission.Duration = duration; - return emission; - }); - - return emissions; + return data.Where(d => ((startTime <= d.DateTime) && (d.DateTime < endTime)) || + ((startTime <= d.DateTime.Add(duration)) && (d.DateTime.Add(duration) < endTime)) || + ((d.DateTime < startTime) && (endTime < d.DateTime.Add(duration)))) + .Select(d => + { + var emission = (EmissionsData)d; + emission.Location = location.Name ?? string.Empty; + emission.Time = d.DateTime; + emission.Duration = duration; + return emission; + }); } private TimeSpan GetDurationFromHistoryDataPointsOrDefault(IEnumerable carbonIntensityDataPoints, TimeSpan defaultValue) diff --git a/src/CarbonAware.DataSources/CarbonAware.DataSources.ElectricityMaps/src/Model/HistoryCarbonIntensityData.cs b/src/CarbonAware.DataSources/CarbonAware.DataSources.ElectricityMaps/src/Model/HistoryCarbonIntensityData.cs index abd42ae4e..d96ebc9b8 100644 --- a/src/CarbonAware.DataSources/CarbonAware.DataSources.ElectricityMaps/src/Model/HistoryCarbonIntensityData.cs +++ b/src/CarbonAware.DataSources/CarbonAware.DataSources.ElectricityMaps/src/Model/HistoryCarbonIntensityData.cs @@ -32,7 +32,7 @@ internal record CarbonIntensity /// Carbon Intensity value. /// [JsonPropertyName("carbonIntensity")] - public int Value { get; init; } + public int? Value { get; init; } /// /// Indicates the datetime of the carbon intensity @@ -74,7 +74,7 @@ public static explicit operator EmissionsData(CarbonIntensity historyCarbonInten { return new EmissionsData { - Rating = historyCarbonIntensity.Value, + Rating = historyCarbonIntensity.Value ?? -1, Time = historyCarbonIntensity.UpdatedAt, }; } diff --git a/src/CarbonAware.DataSources/CarbonAware.DataSources.ElectricityMaps/test/Client/ElectricityMapsClientTests.cs b/src/CarbonAware.DataSources/CarbonAware.DataSources.ElectricityMaps/test/Client/ElectricityMapsClientTests.cs index 2535020ee..d8255e3aa 100644 --- a/src/CarbonAware.DataSources/CarbonAware.DataSources.ElectricityMaps/test/Client/ElectricityMapsClientTests.cs +++ b/src/CarbonAware.DataSources/CarbonAware.DataSources.ElectricityMaps/test/Client/ElectricityMapsClientTests.cs @@ -8,6 +8,7 @@ using Moq.Protected; using Moq.Contrib.HttpClient; using System.Text.Json; +using CarbonAware.Model; namespace CarbonAware.DataSources.ElectricityMaps.Tests; @@ -299,4 +300,36 @@ private void AddHandler_RequestResponse(Predicate requestPre .ReturnsResponse(statusCode); } } + + [Test] + public async Task GetRecentCarbonIntensityHistoryAsync_DeserializesExpectedResponseWithNull() + { + AddHandler_RequestResponse(r => + { + return r.Method == HttpMethod.Get; + }, System.Net.HttpStatusCode.OK, TestData.GetHistoryCarbonIntensityDataJsonStringWithNull()); + + var client = new ElectricityMapsClient(this.HttpClientFactory, this.Options.Object, this.Log.Object); + + // Act + var data = await client.GetRecentCarbonIntensityHistoryAsync(TestLatitude, TestLongitude); + var dataPoint = data?.HistoryData.First(); + + // Assert + Assert.That(data, Is.Not.Null); + Assert.That(data?.Zone, Is.EqualTo(TestZone)); + Assert.That(data?.HistoryData.Count(), Is.GreaterThan(0)); + Assert.Multiple(() => + { + Assert.That(dataPoint?.DateTime, Is.EqualTo(new DateTimeOffset(2099, 1, 1, 0, 0, 0, TimeSpan.Zero))); + Assert.That(dataPoint?.UpdatedAt, Is.EqualTo(new DateTimeOffset(2099, 1, 1, 0, 0, 0, TimeSpan.Zero))); + Assert.That(dataPoint?.CreatedAt, Is.EqualTo(new DateTimeOffset(2099, 1, 1, 0, 0, 0, TimeSpan.Zero))); + Assert.That(dataPoint?.Value, Is.Null); + Assert.That(((EmissionsData)dataPoint).Rating, Is.EqualTo(-1)); + Assert.That(dataPoint?.EmissionFactorType, Is.EqualTo("lifecycle")); + Assert.That(dataPoint?.IsEstimated, Is.False); + Assert.That(dataPoint?.EstimationMethod, Is.Null); + }); + } + } diff --git a/src/CarbonAware.DataSources/CarbonAware.DataSources.ElectricityMaps/test/Client/TestData.cs b/src/CarbonAware.DataSources/CarbonAware.DataSources.ElectricityMaps/test/Client/TestData.cs index 761604a47..3a1a8da20 100644 --- a/src/CarbonAware.DataSources/CarbonAware.DataSources.ElectricityMaps/test/Client/TestData.cs +++ b/src/CarbonAware.DataSources/CarbonAware.DataSources.ElectricityMaps/test/Client/TestData.cs @@ -92,4 +92,28 @@ public static string GetCurrentForecastJsonString() return json.ToString(); } + + public static string GetHistoryCarbonIntensityDataJsonStringWithNull() + { + var json = new JsonObject + { + ["zone"] = TestZoneId1, + ["history"] = new JsonArray + { + new JsonObject + { + ["datetime"] = new DateTimeOffset(2099, 1, 1, 0, 0, 0, TimeSpan.Zero), + ["updatedAt"] = new DateTimeOffset(2099, 1, 1, 0, 0, 0, TimeSpan.Zero), + ["createdAt"] = new DateTimeOffset(2099, 1, 1, 0, 0, 0, TimeSpan.Zero), + ["carbonIntensity"] = null, + ["emissionFactorType"] = "lifecycle", + ["isEstimated"] = false, + ["estimatedMethod"] = null, + } + } + }; + + return json.ToString(); + } + } \ No newline at end of file diff --git a/src/CarbonAware.DataSources/CarbonAware.DataSources.ElectricityMaps/test/ElectricityMapsDataSourceTests.cs b/src/CarbonAware.DataSources/CarbonAware.DataSources.ElectricityMaps/test/ElectricityMapsDataSourceTests.cs index ff1dcc56a..58bddc973 100644 --- a/src/CarbonAware.DataSources/CarbonAware.DataSources.ElectricityMaps/test/ElectricityMapsDataSourceTests.cs +++ b/src/CarbonAware.DataSources/CarbonAware.DataSources.ElectricityMaps/test/ElectricityMapsDataSourceTests.cs @@ -134,6 +134,7 @@ public async Task GetCarbonIntensity_CallsExpectedClientEndpoint(int startTimeOf public async Task GetCarbonIntensity_DateRangeWithin24Hours_ReturnsResultsWhenRecordsFound() { var startDate = DateTimeOffset.UtcNow.AddHours(-10); + var expectedDate = startDate.AddMinutes(-10); var endDate = startDate.AddHours(1); var expectedCarbonIntensity = 100; @@ -145,10 +146,12 @@ public async Task GetCarbonIntensity_DateRangeWithin24Hours_ReturnsResultsWhenRe { new CarbonIntensity() { - Value = expectedCarbonIntensity, + DateTime = startDate.AddMinutes(-40), // out of range + Value = 0, }, new CarbonIntensity() { + DateTime = expectedDate, Value = expectedCarbonIntensity, } } @@ -162,10 +165,11 @@ public async Task GetCarbonIntensity_DateRangeWithin24Hours_ReturnsResultsWhenRe var result = await this._dataSource.GetCarbonIntensityAsync(new List() { _defaultLocation }, startDate, endDate); Assert.IsNotNull(result); - Assert.That(result.Count(), Is.EqualTo(2)); + Assert.That(result.Count(), Is.EqualTo(1)); var first = result.First(); Assert.IsNotNull(first); + Assert.That(expectedDate, Is.EqualTo(first.Time)); Assert.That(first.Rating, Is.EqualTo(expectedCarbonIntensity)); Assert.That(first.Location, Is.EqualTo(_defaultLocation.Name)); @@ -176,6 +180,7 @@ public async Task GetCarbonIntensity_DateRangeWithin24Hours_ReturnsResultsWhenRe public async Task GetCarbonIntensity_DateRangeMore24Hours_ReturnsResultsWhenRecordsFound() { var startDate = _defaultDataStartTime; + var expectedDate = startDate.AddMinutes(-10); var endDate = startDate.AddHours(1); var expectedCarbonIntensity = 100; @@ -187,10 +192,12 @@ public async Task GetCarbonIntensity_DateRangeMore24Hours_ReturnsResultsWhenReco { new CarbonIntensity() { - Value = expectedCarbonIntensity, + DateTime = startDate.AddMinutes(-40), // out of range + Value = 0, }, new CarbonIntensity() { + DateTime = expectedDate, Value = expectedCarbonIntensity, } } @@ -206,10 +213,11 @@ public async Task GetCarbonIntensity_DateRangeMore24Hours_ReturnsResultsWhenReco var result = await this._dataSource.GetCarbonIntensityAsync(new List() { _defaultLocation }, startDate, endDate); Assert.IsNotNull(result); - Assert.That(result.Count(), Is.EqualTo(2)); + Assert.That(result.Count(), Is.EqualTo(1)); var first = result.First(); Assert.IsNotNull(first); + Assert.That(expectedDate, Is.EqualTo(first.Time)); Assert.That(first.Rating, Is.EqualTo(expectedCarbonIntensity)); Assert.That(first.Location, Is.EqualTo(_defaultLocation.Name)); @@ -261,7 +269,9 @@ public async Task GetDurationBetweenHistoryDataPoints_ReturnsDefaultDuration_Whe { HistoryData = new List() { - new CarbonIntensity() + new CarbonIntensity(){ + DateTime = startDate.AddMinutes(30), + }, } }; @@ -285,7 +295,7 @@ public async Task GetDurationBetweenHistoryDataPoints_WhenMultipleDataPoints_Ret { var startDate = DateTimeOffset.UtcNow.AddHours(-8); var endDate = startDate.AddHours(1); - var expectedDuration = TimeSpan.FromHours(1); + var expectedDuration = TimeSpan.FromMinutes(59); // Arrange _locationSource.Setup(l => l.ToGeopositionLocationAsync(_defaultLocation)).Returns(Task.FromResult(_defaultLocation)); diff --git a/src/CarbonAware.WebApi/src/Configuration/ServiceCollectionExtensions.cs b/src/CarbonAware.WebApi/src/Configuration/ServiceCollectionExtensions.cs index 0c1458b23..f7f796903 100644 --- a/src/CarbonAware.WebApi/src/Configuration/ServiceCollectionExtensions.cs +++ b/src/CarbonAware.WebApi/src/Configuration/ServiceCollectionExtensions.cs @@ -1,6 +1,8 @@ using Microsoft.Extensions.Options; using CarbonAware.WebApi.Metrics; using OpenTelemetry.Metrics; +using OpenTelemetry.Resources; +using OpenTelemetry.Trace; namespace CarbonAware.WebApi.Configuration; @@ -32,7 +34,23 @@ public static void AddMonitoringAndTelemetry(this IServiceCollection services, I // Can be extended in the future to support a different provider like Zipkin, Prometheus etc } + var enableTelemetryLogging = envVars?.EnableTelemetryLogging ?? true; + if (enableTelemetryLogging) + { + const string serviceName = "CarbonAware.WebAPI"; + const string serviceVersion = "1.0.0"; + services.AddOpenTelemetry() + .WithTracing(tracerProviderBuilder => + tracerProviderBuilder + .AddConsoleExporter() + .AddSource(serviceName) + .SetResourceBuilder( + ResourceBuilder.CreateDefault() + .AddService(serviceName: serviceName, serviceVersion: serviceVersion)) + .AddHttpClientInstrumentation() + .AddAspNetCoreInstrumentation()); + } } public static IServiceCollection AddCarbonExporter(this IServiceCollection services, IConfiguration configuration) diff --git a/src/CarbonAware.WebApi/src/Program.cs b/src/CarbonAware.WebApi/src/Program.cs index b027ad12f..3a40c28d5 100644 --- a/src/CarbonAware.WebApi/src/Program.cs +++ b/src/CarbonAware.WebApi/src/Program.cs @@ -5,29 +5,11 @@ using GSF.CarbonAware.Configuration; using GSF.CarbonAware.Exceptions; using Microsoft.OpenApi.Models; -using OpenTelemetry.Resources; -using OpenTelemetry.Trace; -using OpenTelemetry.Metrics; using Swashbuckle.AspNetCore.SwaggerGen; using System.Reflection; -// Define constants to initialize tracing with -var serviceName = "CarbonAware.WebAPI"; -var serviceVersion = "1.0.0"; - var builder = WebApplication.CreateBuilder(args); -builder.Services.AddOpenTelemetry() - .WithTracing(tracerProviderBuilder => - tracerProviderBuilder - .AddConsoleExporter() - .AddSource(serviceName) - .SetResourceBuilder( - ResourceBuilder.CreateDefault() - .AddService(serviceName: serviceName, serviceVersion: serviceVersion)) - .AddHttpClientInstrumentation() - .AddAspNetCoreInstrumentation()); - // Add services to the container. builder.Services.AddControllers(options => { diff --git a/src/CarbonAware.WebApi/test/unitTests/Configuration/ServiceCollectionExtensionsTests.cs b/src/CarbonAware.WebApi/test/unitTests/Configuration/ServiceCollectionExtensionsTests.cs index f675160a2..beae4fc5f 100644 --- a/src/CarbonAware.WebApi/test/unitTests/Configuration/ServiceCollectionExtensionsTests.cs +++ b/src/CarbonAware.WebApi/test/unitTests/Configuration/ServiceCollectionExtensionsTests.cs @@ -3,6 +3,8 @@ using Microsoft.Extensions.DependencyInjection; using Microsoft.Extensions.Configuration; using NUnit.Framework.Internal; +using OpenTelemetry.Trace; +using Microsoft.ApplicationInsights; namespace CarbonAware.WepApi.UnitTests; @@ -79,8 +81,8 @@ public void AddMonitoringAndTelemetry_DoesNotAddServices_WithoutTelemetryProvide // Act & Assert Assert.DoesNotThrow(() => services.AddMonitoringAndTelemetry(configuration)); - Assert.That(services.Count, Is.EqualTo(0)); - } + Assert.Null(services.BuildServiceProvider().GetService()); + } [Test] public void AddCarbonExporter_AddsServices_IsEnabledInConfiguration() @@ -156,4 +158,58 @@ public void CreateConsoleLogger_ReturnsILogger() // Assert Assert.That(logger, Is.Not.Null); } + + [Test] + public void EnableTelemetryLogging_AddsServices_WithoutConfiguration() + { + // Arrange + var services = new ServiceCollection(); + + var inMemorySettings = new Dictionary { }; + var configuration = new ConfigurationBuilder() + .AddInMemoryCollection(inMemorySettings) + .Build(); + + // Act & Assert + Assert.DoesNotThrow(() => services.AddMonitoringAndTelemetry(configuration)); + Assert.NotNull(services.BuildServiceProvider().GetService()); + } + + [Test] + public void EnableTelemetryLogging_AddsServices_IsEnabledInConfiguration() + { + // Arrange + var services = new ServiceCollection(); + + var inMemorySettings = new Dictionary + { + { "CarbonAwareVars:EnableTelemetryLogging", "true" } + }; + var configuration = new ConfigurationBuilder() + .AddInMemoryCollection(inMemorySettings) + .Build(); + + // Act & Assert + Assert.DoesNotThrow(() => services.AddMonitoringAndTelemetry(configuration)); + Assert.NotNull(services.BuildServiceProvider().GetService()); + } + + [Test] + public void EnableTelemetryLogging_AddsServices_IsDisabledInConfiguration() + { + // Arrange + var services = new ServiceCollection(); + + var inMemorySettings = new Dictionary + { + { "CarbonAwareVars:EnableTelemetryLogging", "false" } + }; + var configuration = new ConfigurationBuilder() + .AddInMemoryCollection(inMemorySettings) + .Build(); + + // Act & Assert + Assert.DoesNotThrow(() => services.AddMonitoringAndTelemetry(configuration)); + Assert.Null(services.BuildServiceProvider().GetService()); + } } \ No newline at end of file diff --git a/src/CarbonAware/src/CarbonAwareVariablesConfiguration.cs b/src/CarbonAware/src/CarbonAwareVariablesConfiguration.cs index ae37c78aa..fc0ba2da3 100644 --- a/src/CarbonAware/src/CarbonAwareVariablesConfiguration.cs +++ b/src/CarbonAware/src/CarbonAwareVariablesConfiguration.cs @@ -36,6 +36,8 @@ internal class CarbonAwareVariablesConfiguration public string TelemetryProvider { get; set; } + public Boolean EnableTelemetryLogging { get; set; } + public Boolean EnableCarbonExporter { get;set; } public Boolean VerboseApi {get; set;}