Skip to content
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

Allow customized topic name format #60

Closed
jkorab opened this issue Jul 30, 2020 · 11 comments · Fixed by #86
Closed

Allow customized topic name format #60

jkorab opened this issue Jul 30, 2020 · 11 comments · Fixed by #86
Labels
enhancement New feature or request questions and help Questions and help on using the Topology Builder
Milestone

Comments

@jkorab
Copy link

jkorab commented Jul 30, 2020

Add a topicNameFormat configuration element with tokens that pull in environment variables, and also ones that correspond to the config elements. That way, if people wanted to tweak the default conventions, it's configurable.
e.g.
topicNameFormat={env.CP_ENVIRONMENT_NAME}-{team}-{source}-{project}-{topic}

@purbon
Copy link
Collaborator

purbon commented Aug 1, 2020

Hi @jkorab
thanks a lot for your question.

Actually currently this is somehow possible, if you build a topology that looks like

---
company: "company"
env: "env"
team: "team"
source: "source"
projects:
  - name: "foo"

this will generate topic that looks like

team.company.env.source.foo.foo

the only key that is mandatory in the topology is the team, because at the end of the story we need a PK for the case when there are multiple files representing a single topology so we can group.

Are you thinking more about the line of adding patterns in the values that get resolved at execution time?

@purbon purbon added question enhancement New feature or request labels Aug 1, 2020
@purbon
Copy link
Collaborator

purbon commented Aug 2, 2020

The current pattern is:

  • [team].[others in order of appearance].[project].[topic]

might be we can add a pattern as configuration ? this might be a way to implement this. What do you think?

@nerdynick
Copy link

I need to add this support for my customer, any opposition against implementing this using Jinja2 templates? Would allow for great flexibility for the end-user, so we don't have to keep making changes to support more use cases. Plus it's a templating engine that most people in the DevOps world are used to.

@purbon
Copy link
Collaborator

purbon commented Aug 11, 2020

that would be awesome, go ahead! if I can help in anyhow let me know :-)

@purbon
Copy link
Collaborator

purbon commented Aug 11, 2020

Just remember at some point we need a way to group multiple files into a single topology so we need to designate a PK for the grouping.

@nerdynick
Copy link

Yeah, that's something I've been thinking through with a few of the changes. I'm looking at the idea of a context that would change based on the Base/Core, Topology file, and the project. This would be to address this issue, as well as the Vault integration, and I'd imagine more features would need this support.

@purbon
Copy link
Collaborator

purbon commented Aug 28, 2020

Hi @nerdynick , are you making any sharable advance on this topic? otherwise I would really like to start tracking this problem here.

@purbon
Copy link
Collaborator

purbon commented Aug 29, 2020

Hi @nerdynick, with #68 I have renamed team for context for a better understanding. I am sorry if this caused problems with your current work line, however I had to do that to enable a few people move forward. The change is a simple rename as context describe much better the purpose of the old team.

@purbon
Copy link
Collaborator

purbon commented Sep 26, 2020

related to #84

@purbon
Copy link
Collaborator

purbon commented Sep 27, 2020

@jkorab I added #86 to implement a solution for this request. Would you be so nice to let me know if this fits your expectations? thanks a lot.

@purbon
Copy link
Collaborator

purbon commented Sep 27, 2020

@nerdynick I know you are working on this, however I need to move forward with it. happy to get your feedback as well.

@purbon purbon closed this as completed in #86 Oct 1, 2020
@purbon purbon added questions and help Questions and help on using the Topology Builder and removed question labels Apr 2, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request questions and help Questions and help on using the Topology Builder
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants