Skip to content

closing-remarks shows earliest tag alphabetically, not chronologically #7208

Closed as not planned

Description

@aryairani

Description

The feature says the first tag containing the PR was pre-release

image

But the first tag is actually release/0.5.13; pre-release happens to be the last tag containing the PR.

image

Note: the pre-release tag in this repo changes over time, but the bug still happens after clearing the extension cache, so I don't suppose it's a stale result.

How to replicate the issue + URL

unisonweb/unison#4519

Extension version

23.12.17

Browser(s) used

Chrome 120.0.6099.129 (Official Build) (arm64)

Activity

  1. fregante commented on Jan 9, 2024

    @fregante
    Member
  2. changed the title [-]"Shows the first Git tag a merged PR was included in" shows me the wrong tag?[/-] [+]`closing-remarks` shows pre-release tags[/+] on Jan 9, 2024
  3. fregante commented on Jan 9, 2024

    @fregante
    Member

    Thank you @aryairani 🙏 ☺️

  4. aryairani commented on Jan 9, 2024

    @aryairani
    Author

    Hi @fregante — I'm a little uncertain. I don't believe it's an issue of excluding or including pre-release tags.

    My understanding is that the UI is supposed to show the earliest tag that included the PR in question. In my scenario, the earliest tag isn't the pre-release tag, it's the actual release tag; but the UI is showing the pre-release tag.

    What am I missing?
    Thank you!

  5. aryairani commented on Jan 9, 2024

    @aryairani
    Author

    (Actually I think it might the same issue described in #7206, but the submitter mistakenly focused on "pre-release" vs "release" metadata, which I think are a red herring which led to the issue being closed prima facie.)

  6. fregante commented on Jan 10, 2024

    @fregante
    Member

    We just ask GitHub for the order, so you can change it by changing the time of creation of the tags. But the core logic remains: this pattern requires --force, so it's not something we should support

  7. changed the title [-]`closing-remarks` shows pre-release tags[/-] [+]`closing-remarks` doesn't show earliest tag[/+] on Jan 10, 2024
  8. aryairani commented on Jan 10, 2024

    @aryairani
    Author

    We just ask GitHub for the order, so you can change it by changing the time of creation of the tags. But the core logic remains: this pattern requires --force, so it's not something we should support

    Sorry, I still didn't understand. I do want pre-release tags to be included in the results. #7206 is asking to exclude pre-releases, but I'm not asking for that. I'm just reporting that in this case the pre-release tag is not the earliest tag, but it's being reported as the earliest tag.

    I think maybe the order is coming back wrong or needs to be sorted differently?

    image image

    release/0.5.13 includes the PR and is earlier than pre-release

    We just ask GitHub for the order

    Where does this happen? Maybe I can help debug.

  9. fregante commented on Jan 10, 2024

    @fregante
    Member

    See the firstTag updater function: https://github.com/refined-github/refined-github/blob/main/source/features/closing-remarks.tsx

    I wonder if GitHub is showing the tags in an unexpected order in the dom, I thought we were using the API. Probably there isn't an equivalent API.

  10. aryairani commented on Jan 10, 2024

    @aryairani
    Author

    Should we reopen this bug since I don't think it's a dup of #7206?

  11. fregante commented on Jan 10, 2024

    @fregante
    Member

    So it seems that GitHub lists tag in alphabetical order:

    We expect the "earliest tag" to appear last on that list, because that's generally the case.

    To fix this issue and to future-proof this feature, I'd be open to use the API, if it's possible. I think we went with this snippet because the API doesn't expose this information, calculating it would be expensive.

  12. changed the title [-]`closing-remarks` doesn't show earliest tag[/-] [+]`closing-remarks` doesn't show earliest tag if non-version tags exist[/+] on Jan 10, 2024
  13. aryairani commented on Jan 10, 2024

    @aryairani
    Author

    As a workaround I will maybe rename my pre-release to nightly, which comes before release in alphabetical order. 🤦 Thanks for looking into this.

  14. wookayin commented on Jan 10, 2024

    @wookayin

    @aryairani Alphabetically, nightly < pre-release < release-* < v, so you might instead want a tag that comes after release, i.e. s, t, u, v, w, ... I have a similar issue with you in #7206, where nightly precedes v.

  15. aryairani commented on Jan 12, 2024

    @aryairani
    Author

    @wookayin Oh yeah! 🤦
    @fregante maybe this issue should be "closing-remarks shows earliest tag alphabetically rather than chronologically".
    i.e. you could see the same problem if the versioning scheme changes (even though none of them would necessarily be non-version tags)

  16. changed the title [-]`closing-remarks` doesn't show earliest tag if non-version tags exist[/-] [+]`closing-remarks` shows earliest tag alphabetically, not chronologically[/+] on Jan 26, 2024
  17. aryairani commented on Jan 26, 2024

    @aryairani
    Author

    Ok, I guess I have my functioning workaround in place now, thanks to @wookayin's alphabet help, by calling my nightly tag trunk-build, which comes after release/* alphabetically. (I had called it my "trunk build" tag trunk briefly, but ran into conflicts with the trunk branch.)

  18. fregante commented on Feb 2, 2024

    @fregante
    Member

    Tags that include the word nightly and tags that don't have a version (minimum \d\.\d expected) are now excluded:

    This specific issue can stay open because I'd still want ordering, but I think this can only be done via API. The API can return the tags in order of creation.

    I don't want to get into the sorting of tags out of the current HTML snippet because soon enough there will be a repo with 1.0.0 and release/2.0.0 and beta/2.0.0 and I can't figure out every combination of that.

  19. fregante commented on Jun 12, 2024

    @fregante
    Member

    To fix this issue and to future-proof this feature, I'd be open to use the API, if it's possible. I think we went with this snippet because the API doesn't expose this information, calculating it would be expensive.

    This information is not available on the API. This can be confirmed by visiting their docs:

    https://docs.github.com/en/graphql/reference/objects#commit

    In the Commit object, there's no way to get any tag references.

    If we had access to git, this would be possible via git tag --contains the-commit-hash

  20. deleted a comment from on Aug 9, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions