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

[Fleet] Link to download page of current stack version on Agent install instructions #104494

Merged
merged 3 commits into from
Jul 7, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ jest.mock('./steps', () => {
AgentPolicySelectionStep: jest.fn(),
AgentEnrollmentKeySelectionStep: jest.fn(),
ViewDataStep: jest.fn(),
DownloadStep: jest.fn(),
};
});

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,15 +9,24 @@ import React, { useCallback, useMemo } from 'react';
import { EuiText, EuiButton, EuiSpacer } from '@elastic/eui';
import { FormattedMessage } from '@kbn/i18n/react';
import { i18n } from '@kbn/i18n';
import semver from 'semver';

import type { AgentPolicy, PackagePolicy } from '../../types';
import { sendGetOneAgentPolicy } from '../../hooks';
import { sendGetOneAgentPolicy, useKibanaVersion } from '../../hooks';
import { FLEET_SERVER_PACKAGE } from '../../constants';

import { EnrollmentStepAgentPolicy } from './agent_policy_selection';
import { AdvancedAgentAuthenticationSettings } from './advanced_agent_authentication_settings';

export const DownloadStep = () => {
const kibanaVersion = useKibanaVersion();
const kibanaVersionURLString = useMemo(
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's not a blocker for me, but in the main branch this will go to https://www.elastic.co/downloads/past-releases/elastic-agent-8-0-0 which 404's.

I don't know if it's better to leave the existing https://ela.st/download-elastic-agent for snapshot builds or use this invalid URL

One optional enhancement for another time/PR is to use the results from https://artifacts-api.elastic.co/v1/search/8.0-SNAPSHOT/elastic-agent to make a list of links like below (in the flyout?)
Screen Shot 2021-07-07 at 12 10 52 PM

None of these are requirements to ship, IMO; just pointing out what I noticed

() =>
`${semver.major(kibanaVersion)}-${semver.minor(kibanaVersion)}-${semver.patch(
kibanaVersion
)}`,
[kibanaVersion]
);
return {
title: i18n.translate('xpack.fleet.agentEnrollment.stepDownloadAgentTitle', {
defaultMessage: 'Download the Elastic Agent to your host',
Expand All @@ -30,9 +39,16 @@ export const DownloadStep = () => {
defaultMessage="Fleet Server runs on an Elastic Agent. You can download the Elastic Agent binaries and verification signatures from Elastic’s download page."
/>
</EuiText>
<EuiSpacer size="s" />
<EuiText size="s">
<FormattedMessage
id="xpack.fleet.agentEnrollment.downloadUseLinuxInstaller"
defaultMessage="Linux users: We recommend using the installers over (RPM/DEB) because they provide the ability to upgrade your agent within Fleet."
/>
</EuiText>
<EuiSpacer size="l" />
<EuiButton
href="https://ela.st/download-elastic-agent"
href={`https://www.elastic.co/downloads/past-releases/elastic-agent-${kibanaVersionURLString}`}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

one thing that will be annoying, is that this link will be broken for releases which are not published yet (i.e. local development from master/8.0.0, build candidates like the upcoming 7.14.0)

but I'm not sure what we can do about that. @mostlyjason WDYT?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I was concerned about that too, but there doesn't seem to be an easy way to determine in the code whether or not a version is released yet. This might just have to be a thing we deal with in development.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

sgtm 👍🏻

target="_blank"
iconSide="right"
iconType="popout"
Expand Down