Skip to content

docs: use the 'latest' GH release API for the latest extension or agent release #402

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

Merged
merged 1 commit into from
Sep 5, 2023

Conversation

trentm
Copy link
Member

@trentm trentm commented Aug 31, 2023

The "Monitoring AWS Lambda $lang Functions" doc pages use some
in-browser JS to interpolate the ARNs for the latest Lambda extension
release and the latest APM agent release. This changes that JS to use
the "latest release" GH API
https://api.github.com/repos/elastic/${ghRepo}/releases/latest
rather than listing all (or the first page of GH releases):
https://api.github.com/repos/elastic/${ghRepo}/releases
and picking the latest by release.created_at.

GH releases for a repo have a sense of the "latest" release
(see --latest flag to https://cli.github.com/manual/gh_release_create)
even if it isn't the latest tag or published release in time. The
Node.js APM agent will soon have 4.x releases and 3.x maintenance
releases. It is possible that a 3.x release is the latest in time, but
not marked as the "latest" release. This change ensures that the
Lambda doc page will pick the correct (4.x) one.

One of those "Monitoring AWS Lambda ..." docs pages: https://www.elastic.co/guide/en/apm/agent/nodejs/current/lambda.html

Testing notes

I tested this with a local build of the Node.js APM agent docs.
I've confirmed that this https://api.github.com/repos/elastic/${ghRepo}/releases/latest API works with
the apm-aws-lambda, apm-agent-python, and apm-agent-java repos -- the only other ones for which this doc JS is run.

…nt release

The "Monitoring AWS Lambda $lang Functions" doc pages use some
in-browser JS to interpolate the ARNs for the latest Lambda extension
release and the latest APM agent release. This changes that JS to use
the "latest release" GH API
    https://api.github.com/repos/elastic/${ghRepo}/releases/latest
rather than listing all (or the first page of GH releases):
    https://api.github.com/repos/elastic/${ghRepo}/releases
and picking the latest by `release.created_at`.

GH releases for a repo have a sense of the "latest" release
(see `--latest` flag to https://cli.github.com/manual/gh_release_create)
even if it isn't the latest tag or published release in time. The
Node.js APM agent will soon have 4.x releases and 3.x maintenance
releases. It is possible that a 3.x release is the latest in time, but
not marked as the "latest" release. This change ensures that the
Lambda doc page will pick the correct (4.x) one.
@trentm trentm requested a review from AlexanderWert August 31, 2023 23:06
@trentm trentm self-assigned this Aug 31, 2023
@github-actions github-actions bot added the aws-λ-extension AWS Lambda Extension label Aug 31, 2023
@trentm trentm mentioned this pull request Aug 31, 2023
24 tasks
@trentm
Copy link
Member Author

trentm commented Sep 5, 2023

@kruskall Would you be willing to merge this? I don't have perms to do so.

@kruskall kruskall merged commit 9899932 into elastic:main Sep 5, 2023
@kruskall
Copy link
Member

kruskall commented Sep 5, 2023

Sure thing! Sorry for the delay and thanks for the contribution!

@trentm
Copy link
Member Author

trentm commented Sep 6, 2023

Thanks.

@trentm trentm deleted the trentm/docs-gh-latest-release-sel branch September 6, 2023 00:09
bmorelli25 pushed a commit to bmorelli25/apm-aws-lambda that referenced this pull request Sep 7, 2023
…nt release (elastic#402)

The "Monitoring AWS Lambda $lang Functions" doc pages use some
in-browser JS to interpolate the ARNs for the latest Lambda extension
release and the latest APM agent release. This changes that JS to use
the "latest release" GH API
    https://api.github.com/repos/elastic/${ghRepo}/releases/latest
rather than listing all (or the first page of GH releases):
    https://api.github.com/repos/elastic/${ghRepo}/releases
and picking the latest by `release.created_at`.

GH releases for a repo have a sense of the "latest" release
(see `--latest` flag to https://cli.github.com/manual/gh_release_create)
even if it isn't the latest tag or published release in time. The
Node.js APM agent will soon have 4.x releases and 3.x maintenance
releases. It is possible that a 3.x release is the latest in time, but
not marked as the "latest" release. This change ensures that the
Lambda doc page will pick the correct (4.x) one.

(cherry picked from commit 9899932)
bmorelli25 pushed a commit to bmorelli25/apm-aws-lambda that referenced this pull request Sep 7, 2023
…nt release (elastic#402)

The "Monitoring AWS Lambda $lang Functions" doc pages use some
in-browser JS to interpolate the ARNs for the latest Lambda extension
release and the latest APM agent release. This changes that JS to use
the "latest release" GH API
    https://api.github.com/repos/elastic/${ghRepo}/releases/latest
rather than listing all (or the first page of GH releases):
    https://api.github.com/repos/elastic/${ghRepo}/releases
and picking the latest by `release.created_at`.

GH releases for a repo have a sense of the "latest" release
(see `--latest` flag to https://cli.github.com/manual/gh_release_create)
even if it isn't the latest tag or published release in time. The
Node.js APM agent will soon have 4.x releases and 3.x maintenance
releases. It is possible that a 3.x release is the latest in time, but
not marked as the "latest" release. This change ensures that the
Lambda doc page will pick the correct (4.x) one.

(cherry picked from commit 9899932)
@bmorelli25
Copy link
Member

💚 All backports created successfully

Status Branch Result
8.9
8.10

Questions ?

Please refer to the Backport tool documentation

bmorelli25 added a commit that referenced this pull request Sep 7, 2023
…nt release (#402) (#407)

The "Monitoring AWS Lambda $lang Functions" doc pages use some
in-browser JS to interpolate the ARNs for the latest Lambda extension
release and the latest APM agent release. This changes that JS to use
the "latest release" GH API
    https://api.github.com/repos/elastic/${ghRepo}/releases/latest
rather than listing all (or the first page of GH releases):
    https://api.github.com/repos/elastic/${ghRepo}/releases
and picking the latest by `release.created_at`.

GH releases for a repo have a sense of the "latest" release
(see `--latest` flag to https://cli.github.com/manual/gh_release_create)
even if it isn't the latest tag or published release in time. The
Node.js APM agent will soon have 4.x releases and 3.x maintenance
releases. It is possible that a 3.x release is the latest in time, but
not marked as the "latest" release. This change ensures that the
Lambda doc page will pick the correct (4.x) one.

(cherry picked from commit 9899932)

Co-authored-by: Trent Mick <[email protected]>
bmorelli25 added a commit that referenced this pull request Sep 7, 2023
…nt release (#402) (#408)

The "Monitoring AWS Lambda $lang Functions" doc pages use some
in-browser JS to interpolate the ARNs for the latest Lambda extension
release and the latest APM agent release. This changes that JS to use
the "latest release" GH API
    https://api.github.com/repos/elastic/${ghRepo}/releases/latest
rather than listing all (or the first page of GH releases):
    https://api.github.com/repos/elastic/${ghRepo}/releases
and picking the latest by `release.created_at`.

GH releases for a repo have a sense of the "latest" release
(see `--latest` flag to https://cli.github.com/manual/gh_release_create)
even if it isn't the latest tag or published release in time. The
Node.js APM agent will soon have 4.x releases and 3.x maintenance
releases. It is possible that a 3.x release is the latest in time, but
not marked as the "latest" release. This change ensures that the
Lambda doc page will pick the correct (4.x) one.

(cherry picked from commit 9899932)

Co-authored-by: Trent Mick <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
aws-λ-extension AWS Lambda Extension
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

4 participants