question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Support for segment aliases?

See original GitHub issue

From PEP 440:

Pre-releases allow the additional spellings of alpha, beta, c, pre, and preview for a, b, rc, rc, and rc respectively. This allows versions such as 1.1alpha1, 1.1beta2, or 1.1c3 which normalize to 1.1a1, 1.1b2, and 1.1rc3. In every case the additional spelling should be considered equivalent to their normal forms.

In other words, here:

  • beta/b are aliases
  • alpha/a are aliases
  • rc/r are aliases

in this scheme.

I realize bump2version is not designed to cater to PEP440’s schema, per se, but this concept of aliasing certain parts (rather than requiring that values is sequential) extends to other slightly different schemes also.

I have a half-baked feature branch that partially implements the ability to specify aliases in bumpversion values config. For instance, it allows

values = 
  dev
  alpha,a
  beta,b
  rc,c

What I have actually found challenging, because there is a good deal of ambiguity involved, is how optional_value and first_value would need to be/allowed to be specified.

Questions for @c4urself and @ekohl

  • Thoughts on usefulness of adding this feature?
  • Does there seem to be any more intuitive way to allow the user to specify aliases versus the example shown above?
  • Thoughts on how strict you’d want to be about what correspondingly would be accepted as optional_value/first_value?

It would come down to something like setting section_config["values"] in cli.py to have some list/tuple elements rather than just str, with some corresponding changes in version_part.py and functions.py.

Issue Analytics

  • State:open
  • Created 3 years ago
  • Comments:5

github_iconTop GitHub Comments

1reaction
florislacommented, Jan 20, 2021
* Does there seem to be any more intuitive way to allow the user to specify aliases versus the example shown above?

You could consider leaving values as-is showing the canonical (or preferred) names, and introducing another keyword aliases.

values = 
  dev
  alpha
  beta
  rc
aliases =
  alpha: a, alph
  beta: b
  rc: r, gamma
  dev: d
0reactions
florislacommented, Jan 23, 2021

I have a half-baked feature branch that partially implements the ability to specify aliases in bumpversion values config.

Do you support serializing with aliases as well?

If you only care about parsing the aliases, then bump2version will never put an alias in a file? You would need to manually edit the version to introduce them, and they would disappear on the next bump.

Edit: just found #174, which might be relevant for context.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Spec: Alias | Segment Documentation
The alias method is used to merge two user identities, effectively connecting two sets of user data as one. This is an advanced...
Read more >
Best Practices for Identifying Users | Segment Documentation
The Alias call links client-side anonymous visitors with server-identified users. ... Contact Segment Support for assistance!
Read more >
Spec: Identify | Segment Documentation
The Segment Identify call lets you tie a user to their actions and record traits about them. It includes a unique User ID...
Read more >
Analytics.js 2.0 Source | Segment Documentation
The Alias method combines two unassociated user identities. Segment usually handles aliasing automatically when you call identify on a user, ...
Read more >
Engage Frequently Asked Questions | Segment Documentation
For Destinations that support an alias call (for example, Mixpanel), you can emit an alias call on merge. What Sources can I sync...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found