Skip to content

Commit

Permalink
[8.16] [Connector] Checkout to right version (#200623) (#200636)
Browse files Browse the repository at this point in the history
# Backport

This will backport the following commits from `main` to `8.16`:
- [[Connector] Checkout to right version
(#200623)](#200623)

<!--- Backport version: 9.4.3 -->

### Questions ?
Please refer to the [Backport tool
documentation](https://github.com/sqren/backport)

<!--BACKPORT [{"author":{"name":"Jedr
Blaszyk","email":"[email protected]"},"sourceCommit":{"committedDate":"2024-11-18T19:08:38Z","message":"[Connector]
Checkout to right version (#200623)\n\n## Summary\r\n\r\nWhen running
`connectors` from sources let's checkout to the right git\r\ntag. If
version is not provided use `main` branch as default value.\r\n\r\nIf
version is provided use git tag e.g. `v8.16.0` to checkout to
right\r\nversion of connectors repo.\r\n\r\nThis fixes the bug when
running `9.0` (main) connectors against <9.0\r\nstack what causes
issues.\r\n\r\nSimilar logic to how we handle versioning docker
images\r\nhttps://github.com/elastic/kibana/blob/main/x-pack/plugins/enterprise_search/public/applications/enterprise_search_content/components/connector_detail/deployment.tsx#L204","sha":"f6ba99da0978e9687292f94761ba41a545098c9f","branchLabelMapping":{"^v9.0.0$":"main","^v8.17.0$":"8.x","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["backport","release_note:skip","v9.0.0","Team:Search","v8.17.0","v8.16.1"],"title":"[Connector]
Checkout to right
version","number":200623,"url":"https://github.com/elastic/kibana/pull/200623","mergeCommit":{"message":"[Connector]
Checkout to right version (#200623)\n\n## Summary\r\n\r\nWhen running
`connectors` from sources let's checkout to the right git\r\ntag. If
version is not provided use `main` branch as default value.\r\n\r\nIf
version is provided use git tag e.g. `v8.16.0` to checkout to
right\r\nversion of connectors repo.\r\n\r\nThis fixes the bug when
running `9.0` (main) connectors against <9.0\r\nstack what causes
issues.\r\n\r\nSimilar logic to how we handle versioning docker
images\r\nhttps://github.com/elastic/kibana/blob/main/x-pack/plugins/enterprise_search/public/applications/enterprise_search_content/components/connector_detail/deployment.tsx#L204","sha":"f6ba99da0978e9687292f94761ba41a545098c9f"}},"sourceBranch":"main","suggestedTargetBranches":["8.x","8.16"],"targetPullRequestStates":[{"branch":"main","label":"v9.0.0","branchLabelMappingKey":"^v9.0.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/200623","number":200623,"mergeCommit":{"message":"[Connector]
Checkout to right version (#200623)\n\n## Summary\r\n\r\nWhen running
`connectors` from sources let's checkout to the right git\r\ntag. If
version is not provided use `main` branch as default value.\r\n\r\nIf
version is provided use git tag e.g. `v8.16.0` to checkout to
right\r\nversion of connectors repo.\r\n\r\nThis fixes the bug when
running `9.0` (main) connectors against <9.0\r\nstack what causes
issues.\r\n\r\nSimilar logic to how we handle versioning docker
images\r\nhttps://github.com/elastic/kibana/blob/main/x-pack/plugins/enterprise_search/public/applications/enterprise_search_content/components/connector_detail/deployment.tsx#L204","sha":"f6ba99da0978e9687292f94761ba41a545098c9f"}},{"branch":"8.x","label":"v8.17.0","branchLabelMappingKey":"^v8.17.0$","isSourceBranch":false,"state":"NOT_CREATED"},{"branch":"8.16","label":"v8.16.1","branchLabelMappingKey":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"}]}]
BACKPORT-->

Co-authored-by: Jedr Blaszyk <[email protected]>
  • Loading branch information
kibanamachine and jedrazb authored Nov 18, 2024
1 parent 0699913 commit b2c5123
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -36,13 +36,15 @@ export interface RunFromSourceStepProps {
connectorId?: string;
isWaitingForConnector: boolean;
serviceType: string;
connectorVersion: string;
}

export const RunFromSourceStep: React.FC<RunFromSourceStepProps> = ({
apiKeyData,
connectorId,
isWaitingForConnector,
serviceType,
connectorVersion,
}) => {
const [isOpen, setIsOpen] = React.useState<EuiAccordionProps['forceState']>('open');
useEffect(() => {
Expand Down Expand Up @@ -125,7 +127,7 @@ export const RunFromSourceStep: React.FC<RunFromSourceStepProps> = ({
<CodeBox
showTopBar={false}
languageType="bash"
codeSnippet="cd connectors && touch config.yml"
codeSnippet={`cd connectors && git checkout ${connectorVersion} && touch config.yml`}
/>
<EuiSpacer size="s" />
<EuiText size="s">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -193,6 +193,7 @@ export const ConnectorDeployment: React.FC = () => {
serviceType={connector.service_type ?? ''}
apiKeyData={apiKey}
isWaitingForConnector={isWaitingForConnector}
connectorVersion={kibanaVersion ? `v${kibanaVersion}` : 'main'}
/>
) : (
<DockerInstructionsStep
Expand Down

0 comments on commit b2c5123

Please sign in to comment.