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

Tag the data-plane-api repository as part of the envoy release process #17904

Closed
jpeach opened this issue Aug 29, 2021 · 5 comments
Closed

Tag the data-plane-api repository as part of the envoy release process #17904

jpeach opened this issue Aug 29, 2021 · 5 comments
Labels
area/go-control-plane area/xds enhancement Feature requests. Not bugs or questions. stale stalebot believes this issue/PR has not been touched recently

Comments

@jpeach
Copy link
Contributor

jpeach commented Aug 29, 2021

Title: Tag the data-plane-api repository as part of the envoy release process

Description:

It it not very clear how to match the xDS API to the right version of Envoy. go-control-plane releases don't line up with Envoy releases, and consuming xDS protobufs directly from the Envoy repository means pulling a large repository and (I think) reimplementing a bunch of tooling.

I did experiment with generating the tags in the data-plane-api repository, but since only protobuf commits get mirrored, there's not enough git history to create all the corresponding tags. Probably solvable by not using bash, but just tagging as part of the envoy release seems more direct and simpler.

I'm happy to help with this if i can, but I expect this needs someone with permissions to tag repositories and a good understanding of the Envoy release machinery.

#! /usr/bin/env bash

set -o errexit

readonly ENVOYDIR=~/upstream/envoy

envoy::tags() {
    (
        cd "$ENVOYDIR"

        # Note that the sort works to order releases from newest to oldest as long
        # as Envoy never goes to v2, or to a 3-digit minor release.
        for release in $(git tag | egrep '^v[[:digit:]]([.][[:digit:]]+)+' | sort -t. -n -r -k 2,3); do
            printf "%s\t%s\n" "$release" "$(git rev-parse "$release")"
        done
    )
}

closest::release() {
    local sha="$1"

    (
        cd "$ENVOYDIR"
     
        git describe --tags "$sha" | grep -E --only-matching '^v[[:digit:]]([.][[:digit:]]+)+'
    )
}

mirror::history() {
    git log | awk '
    BEGIN {
        Count = 0
    }

    /^commit / {
        Commit[Count] = $2
    }

    /Mirrored from/ {
        Mirror[Count] = $5
        Count++
    }

    END {
        for (n = 0; n < Count; n++) {
            printf "%s\t%s\n", Commit[n], Mirror[n]
        }
    }
    '
}

declare -A releases

envoy::tags | while read tag sha ; do
    releases[$tag]=$sha
done

currentvers=

mirror::history | while read sha mirror ; do
    # closest vers tells us the last envoy version that was released
    # prior to this commit.
    closestvers=$(closest::release "$mirror")
    printf "%s\t%s\n" $sha $closestvers

    if [ -z "$currentvers" ]; then
        currentvers=$closestvers
    fi

    # At the version boundary, tag the new version.
    if [ "$currentvers" != "$closestvers" ]; then
        echo git tag "$currentvers" "$sha"
        currentvers=$closestvers
    fi
done
@jpeach jpeach added enhancement Feature requests. Not bugs or questions. triage Issue requires triage labels Aug 29, 2021
@jpeach
Copy link
Contributor Author

jpeach commented Aug 29, 2021

xref envoyproxy/go-control-plane#391

@phlax
Copy link
Member

phlax commented Aug 30, 2021

cc @ggreenway @snowp

@phlax phlax added area/xds area/go-control-plane and removed triage Issue requires triage labels Aug 30, 2021
@alecholmez
Copy link
Contributor

alecholmez commented Aug 31, 2021

@jpeach and I also had an offline conversation about potentially moving the build of go-control-plane away from bazel since it adds quite a bit of complexity. We would reference the data-plane-api protos as the source of truth

@github-actions
Copy link

This issue has been automatically marked as stale because it has not had activity in the last 30 days. It will be closed in the next 7 days unless it is tagged "help wanted" or "no stalebot" or other activity occurs. Thank you for your contributions.

@github-actions github-actions bot added the stale stalebot believes this issue/PR has not been touched recently label Sep 30, 2021
@github-actions
Copy link

github-actions bot commented Oct 8, 2021

This issue has been automatically closed because it has not had activity in the last 37 days. If this issue is still valid, please ping a maintainer and ask them to label it as "help wanted" or "no stalebot". Thank you for your contributions.

@github-actions github-actions bot closed this as completed Oct 8, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/go-control-plane area/xds enhancement Feature requests. Not bugs or questions. stale stalebot believes this issue/PR has not been touched recently
Projects
None yet
Development

No branches or pull requests

3 participants