From d129d422429bf77997868bc15c042a3e9842c5f3 Mon Sep 17 00:00:00 2001
From: Evgeny Yakimov <john.yakimov@gmail.com>
Date: Mon, 12 Apr 2021 06:03:30 +0100
Subject: [PATCH 1/2] Make `Context::HasKey` const (#671)

- Update `Context::HasKey` to be const
- Add const qualifier to HasKey,GetValue to validate constness
---
 api/include/opentelemetry/context/context.h | 2 +-
 api/test/context/context_test.cc            | 4 ++--
 2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/api/include/opentelemetry/context/context.h b/api/include/opentelemetry/context/context.h
index 3f7455e55a..59dcd8cb11 100644
--- a/api/include/opentelemetry/context/context.h
+++ b/api/include/opentelemetry/context/context.h
@@ -76,7 +76,7 @@ class Context
   }
 
   // Checks for key and returns true if found
-  bool HasKey(const nostd::string_view key) noexcept
+  bool HasKey(const nostd::string_view key) const noexcept
   {
     for (DataList *data = head_.get(); data != nullptr; data = data->next_.get())
     {
diff --git a/api/test/context/context_test.cc b/api/test/context/context_test.cc
index 66b7f34c45..ae3144443f 100644
--- a/api/test/context/context_test.cc
+++ b/api/test/context/context_test.cc
@@ -18,7 +18,7 @@ TEST(ContextTest, ContextGetValueReturnsExpectedValue)
 {
   std::map<std::string, context::ContextValue> map_test = {{"test_key", (int64_t)123},
                                                            {"foo_key", (int64_t)456}};
-  context::Context test_context                         = context::Context(map_test);
+  const context::Context test_context                   = context::Context(map_test);
   EXPECT_EQ(nostd::get<int64_t>(test_context.GetValue("test_key")), 123);
   EXPECT_EQ(nostd::get<int64_t>(test_context.GetValue("foo_key")), 456);
 }
@@ -119,7 +119,7 @@ TEST(ContextTest, ContextEmptyMap)
 TEST(ContextTest, ContextHasKey)
 {
   std::map<std::string, context::ContextValue> map_test = {{"test_key", (int64_t)123}};
-  context::Context context_test                         = context::Context(map_test);
+  const context::Context context_test                   = context::Context(map_test);
   EXPECT_TRUE(context_test.HasKey("test_key"));
   EXPECT_FALSE(context_test.HasKey("foo_key"));
 }

From 3ce3e7667fbdfce68c8602a1d776649da97d8e8b Mon Sep 17 00:00:00 2001
From: Lalit Kumar Bhasin <labhas@microsoft.com>
Date: Mon, 12 Apr 2021 22:33:08 +0530
Subject: [PATCH 2/2] Release for 0.4.0  (#672)

---
 CHANGELOG.md                        | 10 +++++++++-
 api/docs/Doxyfile                   |  2 +-
 api/include/opentelemetry/version.h |  2 +-
 docs/public/conf.py                 |  2 +-
 sdk/src/version/version.cc          |  2 +-
 5 files changed, 13 insertions(+), 5 deletions(-)

diff --git a/CHANGELOG.md b/CHANGELOG.md
index 36678ac7c0..8efe92df8b 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -15,7 +15,15 @@ Increment the:
 
 ## [Unreleased]
 
-* [SDK] Read Zipkin endpoint from environment variable. ([#24](https://github.com/open-telemetry/opentelemetry-cpp/pull/624))
+## [0.4.0] 2021-04-12
+
+* [EXPORTER] ETW Exporter enhancements ([#519](https://github.com/open-telemetry/opentelemetry-cpp/pull/519))
+* [EXPORTER] Read Zipkin endpoint from environment variable. ([#624](https://github.com/open-telemetry/opentelemetry-cpp/pull/624))
+* [EXPORTER] Split Zpages webserver hosting from Exporter ([#626](https://github.com/open-telemetry/opentelemetry-cpp/pull/626))
+* [EXPORTER] ETW Exporter Usage Instructions ([#628](https://github.com/open-telemetry/opentelemetry-cpp/pull/628))
+* [INSTRUMENTATION] HTTP Client/Server Instrumentation example ([#632](https://github.com/open-telemetry/opentelemetry-cpp/pull/632))
+* [EXPORTER] Enable tls authentication for otlp grpc exporter ([#635](Enable tls authentication for otlp grpc exporter))
+* [API] Refactoring trace_state to reuse common functionality in baggage ([#638](https://github.com/open-telemetry/opentelemetry-cpp/pull/638/files))
 
 ## [0.3.0] 2021-03-19
 
diff --git a/api/docs/Doxyfile b/api/docs/Doxyfile
index ed2d72b015..a38f30e6c0 100644
--- a/api/docs/Doxyfile
+++ b/api/docs/Doxyfile
@@ -44,7 +44,7 @@ PROJECT_NUMBER         =
 # for a project that appears at the top of each page and should give viewer a
 # quick idea about the purpose of the project. Keep the description short.
 
-PROJECT_BRIEF          = "Version 0.3.0"
+PROJECT_BRIEF          = "Version 0.4.0"
 
 # With the PROJECT_LOGO tag one can specify a logo or an icon that is included
 # in the documentation. The maximum height of the logo should not exceed 55
diff --git a/api/include/opentelemetry/version.h b/api/include/opentelemetry/version.h
index 970fbc5d7c..834d052ec8 100644
--- a/api/include/opentelemetry/version.h
+++ b/api/include/opentelemetry/version.h
@@ -3,7 +3,7 @@
 #include "opentelemetry/detail/preprocessor.h"
 
 #define OPENTELEMETRY_ABI_VERSION_NO 0
-#define OPENTELEMETRY_VERSION "0.3.0"
+#define OPENTELEMETRY_VERSION "0.4.0"
 #define OPENTELEMETRY_ABI_VERSION OPENTELEMETRY_STRINGIFY(OPENTELEMETRY_ABI_VERSION_NO)
 
 // clang-format off
diff --git a/docs/public/conf.py b/docs/public/conf.py
index d3b4095b81..cd11ffeda6 100644
--- a/docs/public/conf.py
+++ b/docs/public/conf.py
@@ -21,7 +21,7 @@
 author = 'OpenTelemetry authors'
 
 # The full version, including alpha/beta/rc tags
-release = '0.3.0'
+release = '0.4.0'
 
 # Run sphinx on subprojects and copy output
 # -----------------------------------------
diff --git a/sdk/src/version/version.cc b/sdk/src/version/version.cc
index b0a20e8b0e..798a0e0468 100644
--- a/sdk/src/version/version.cc
+++ b/sdk/src/version/version.cc
@@ -9,7 +9,7 @@ namespace sdk
 namespace version
 {
 const int MAJOR_VERSION     = 0;
-const int MINOR_VERSION     = 3;
+const int MINOR_VERSION     = 4;
 const int PATCH_VERSION     = 0;
 const char *PRE_RELEASE     = "";
 const char *BUILD_METADATA  = "";