transform-hub icon indicating copy to clipboard operation
transform-hub copied to clipboard

[TOPIC] `si topic create` does not work with space API

Open a-tylenda opened this issue 11 months ago • 0 comments

Describe the bug When creating a new topic using the command si topic create <topicName> it should be added to the space topic list.

Steps to Reproduce

==LOCAL infra==

In the infrastructure MW MM, sth-1, sth-2:

1.  I create topic named newTopic on sth-1

si hub use sth-1

si topic create newTopic

$ si topic create newTopic
{
  id: 'newTopic',
  origin: { id: '::', type: 'hub' },
  state: 'flowing',
  contentType: 'text/plain'
}

2. I check topic list on sth-1, topic is present on the list:

$ si topic ls
[
  {
    contentType: 'text/plain',
    localProvider: '',
    topic: 'newTopic',
    topicName: 'newTopic'
  }
]

3. I check list on sth-2, topic is not present on the list.

$ si hub use sth-2
$ si topic ls
[]

4. I check topic list on space, topic is not present on the list:

curl GET 'http://0.0.0.0:7000/api/v1/space/org-ad6fcd3f-872b-4f7c-b84a-fc64e0a4ad41-manager/api/v1/topics'
[]

==STAGE:==

The same on stage:

$ si topic ls
[]

13:56 $ si topic create newTopic
{
  id: 'newTopic',
  origin: { id: '::', type: 'hub' },
  state: 'flowing',
  contentType: 'text/plain'
}

13:57 $ si topic ls
[
  {
    contentType: 'text/plain',
    localProvider: '',
    topic: 'newTopic',
    topicName: 'newTopic'
  }
]

$ curl  -X GET \
>   'https://api.scp.ovh/api/v1/space/org-f8d19d60-0dc6-446b-9794-c701f5c3a584-manager/api/v1/topics' \
>   --header 'Accept: */*' \
>   --header 'Authorization: Bearer xxx'|jq

[]

The topic list (array) is empty, should contain an object with the topic name newTopic.

Expected behavior Created topic by command si topic create <topicName> should be added to the space topic list.

Version (please complete the following information):

  • STH version: 0.35.0
  • SI version: 0.35.0
  • node version: v18.15.0
  • os: Ubuntu 20.4

a-tylenda avatar Jul 21 '23 14:07 a-tylenda