-
-
Notifications
You must be signed in to change notification settings - Fork 2.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Kafka V1 Support #8381
Kafka V1 Support #8381
Conversation
@bblommers I am having some issue with some of the endpoints. On line 147 of moto/kafka/responses.py, it is correctly printing (and returning) the response but the response isn't correct in the tests. I think it's a URL issues but not sure. Any ideas? |
Hi @jamarcelin! It looks like some of the response-keys simply need to be lowercased. For example: diff --git a/moto/kafka/models.py b/moto/kafka/models.py
index 5cd36741d..e2973d5f8 100644
--- a/moto/kafka/models.py
+++ b/moto/kafka/models.py
@@ -231,11 +231,11 @@ class KafkaBackend(BaseBackend):
):
cluster_info_list = [
{
- "ClusterArn": cluster.arn,
- "ClusterName": cluster.cluster_name,
- "ClusterType": cluster.cluster_type,
- "State": cluster.state,
- "CreationTime": cluster.creation_time,
+ "clusterArn": cluster.arn,
+ "clusterName": cluster.cluster_name,
+ "clusterType": cluster.cluster_type,
+ "state": cluster.state,
+ "creationTime": cluster.creation_time,
}
for cluster in self.clusters.values()
] That change ensures that the This is the first thing I tried, and it happened to work - just because I have run into this problem in the past. The botocore spec is always good place to confirm things like this though, as you can see that they lowercase all |
@bblommers Gotcha, thanks for the help! I fixed the tests and made some changes. The linter is having an issue with broker_node_group_info from FakeKafkaCluster. Any idea how to resolve this? |
Hi @jamarcelin! You can run |
@bblommers Test should be fixed now, just waiting on check to complete. Thanks again! |
@bblommers Hey, sorry to keep pinging, it seems the tests are failing in server mode? Is this caused by an issue with the urls? |
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #8381 +/- ##
========================================
Coverage 94.59% 94.60%
========================================
Files 1159 1163 +4
Lines 101394 101632 +238
========================================
+ Hits 95911 96144 +233
- Misses 5483 5488 +5
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
@jamarcelin I pushed a commit to fix the urls. They have ARNs in them, which contain forward slashes. |
Awesome! Thanks for the help! This looks good to merge to me. Also, is there a specific cadence for releases? Or is there anyway to trigger a release? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you add tests to cover the lines flagged by Codecov? It's unclear, for example, whether or not FakeKafkaCluster.to_dict()
is unreachable code or just not covered by tests.
moto/kafka/models.py
Outdated
partition = get_partition(self.region_name) | ||
return f"arn:{partition}:kafka:{self.region_name}:{self.account_id}:{resource_type}/{self.cluster_id}" | ||
|
||
def to_dict(self) -> Dict[str, Any]: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we not remove this method altogether @jamarcelin? As far as I can tell, it's not used anywhere
I try to do them every two weeks - the next one should come this weekend. 🙂 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great - thank you @jamarcelin!
No description provided.