--- /dev/null
+<svg width="48" height="48" viewBox="0 0 48 48" fill="none" xmlns="http://www.w3.org/2000/svg">
+<path fill-rule="evenodd" clip-rule="evenodd" d="M10 1C14.9707 1 19 5.02932 19 10C19 14.9707 14.9707 19 10 19C5.02932 19 1 14.9707 1 10C1 5.02932 5.02932 1 10 1Z" stroke="#236a97" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/>
+<path fill-rule="evenodd" clip-rule="evenodd" d="M23 19C26.3137 19 29 21.6863 29 25C29 28.3137 26.3137 31 23 31C19.6863 31 17 28.3137 17 25C17 21.6863 19.6863 19 23 19Z" stroke="#236a97" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/>
+<path fill-rule="evenodd" clip-rule="evenodd" d="M23 35C26.3137 35 29 37.6863 29 41C29 44.3137 26.3137 47 23 47C19.6863 47 17 44.3137 17 41C17 37.6863 19.6863 35 23 35Z" stroke="#236a97" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/>
+<path fill-rule="evenodd" clip-rule="evenodd" d="M41 35C44.3137 35 47 37.6863 47 41C47 44.3137 44.3137 47 41 47C37.6863 47 35 44.3137 35 41C35 37.6863 37.6863 35 41 35Z" stroke="#cae3f2" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/>
+<path d="M25.0365 23.6069L21.9673 26.672L20.4766 25.1866" stroke="#236a97" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/>
+<path fill-rule="evenodd" clip-rule="evenodd" d="M41 19C44.3137 19 47 21.6863 47 25C47 28.3137 44.3137 31 41 31C37.6863 31 35 28.3137 35 25C35 21.6863 37.6863 19 41 19Z" stroke="#236a97" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/>
+<path d="M43.0365 23.6069L39.9673 26.672L38.4766 25.1866" stroke="#236a97" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/>
+<path d="M7 6.81201C7 6.02498 7.86709 5.54641 8.533 5.9659L13.6462 9.18692C14.2715 9.58082 14.2682 10.4935 13.6402 10.8829L8.52697 14.0534C7.8608 14.4664 7 13.9873 7 13.2035V6.81201Z" stroke="#236a97" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/>
+<path d="M9 19V34C9 37.866 12.1772 41 16 41H17" stroke="#236a97" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/>
+<path d="M16.949 26C17.5013 26 17.949 25.5523 17.949 25C17.949 24.4477 17.5013 24 16.949 24V26ZM8 19.0352C8 22.8817 11.1183 26 14.9648 26V24C12.2228 24 10 21.7772 10 19.0352H8ZM14.9648 26H16.949V24H14.9648V26Z" fill="#236a97"/>
+<path d="M29.0547 25H34.9993" stroke="#236a97" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/>
+<path fill-rule="evenodd" clip-rule="evenodd" d="M21 40C21.5518 40 22 40.4482 22 41C22 41.5526 21.5518 42 21 42C20.4482 42 20 41.5526 20 41C20 40.4482 20.4482 40 21 40Z" fill="#cae3f2"/>
+<path fill-rule="evenodd" clip-rule="evenodd" d="M25 40C25.5518 40 26 40.4482 26 41C26 41.5526 25.5518 42 25 42C24.4482 42 24 41.5526 24 41C24 40.4482 24.4482 40 25 40Z" fill="#cae3f2"/>
+<path d="M34.0048 41.0069L32.9922 41.0399" stroke="#cae3f2" stroke-width="2" stroke-linecap="round"/>
+</svg>
width: 600px !important;
}
+.abs-width-800 {
+ width: 800px !important;
+}
+
.abs-height-50 {
height: 50px !important;
}
import { getBaseUrl } from 'sonar-ui-common/helpers/urls';
import { AlmBindingDefinition, AlmKeys, ProjectAlmBindingResponse } from '../../types/alm-settings';
import AzurePipelinesTutorial from './azure-pipelines/AzurePipelinesTutorial';
+import GitHubActionTutorial from './github-action/GitHubActionTutorial';
import GitLabCITutorial from './gitlabci/GitLabCITutorial';
import JenkinsTutorial from './jenkins/JenkinsTutorial';
import ManualTutorial from './manual/ManualTutorial';
</header>
<div className="display-flex-justify-center">
+ {projectBinding?.alm === AlmKeys.GitHub && (
+ <button
+ className="button button-huge display-flex-column spacer-left spacer-right tutorial-mode-github"
+ onClick={() => props.onSelectTutorial(TutorialModes.GitHubActions)}
+ type="button">
+ <img
+ alt="" // Should be ignored by screen readers
+ height={64}
+ className="spacer-bottom spacer-top"
+ src={`${getBaseUrl()}/images/tutorials/github-actions.svg`}
+ />
+ <div className="medium big-spacer-top">
+ {translate('onboarding.tutorial.choose_method.github_action')}
+ </div>
+ </button>
+ )}
+
{projectBinding?.alm === AlmKeys.GitLab && (
<button
className="button button-huge display-flex-column spacer-left spacer-right tutorial-mode-gitlab"
<ManualTutorial component={component} currentUser={currentUser} />
)}
+ {selectedTutorial === TutorialModes.GitHubActions && projectBinding !== undefined && (
+ <GitHubActionTutorial
+ baseUrl={baseUrl}
+ component={component}
+ currentUser={currentUser}
+ projectBinding={projectBinding}
+ />
+ )}
+
{selectedTutorial === TutorialModes.Jenkins && projectBinding !== undefined && (
<JenkinsTutorial
almBinding={almBinding}
} from '../TutorialSelectionRenderer';
import { TutorialModes } from '../types';
+it.each([
+ ['bitbucket server', mockProjectBitbucketBindingResponse()],
+ ['github', mockProjectGithubBindingResponse()],
+ ['gitlab', mockProjectGitLabBindingResponse()],
+ ['azure', mockProjectAzureBindingResponse()]
+])('should render correctly for %s', (_, projectBinding) => {
+ expect(shallowRender({ projectBinding })).toMatchSnapshot();
+});
+
it('should render correctly', () => {
expect(shallowRender()).toMatchSnapshot('selection');
- expect(shallowRender({ projectBinding: mockProjectBitbucketBindingResponse() })).toMatchSnapshot(
- 'selection with jenkins available'
- );
expect(shallowRender({ loading: true })).toMatchSnapshot('loading');
expect(shallowRender({ selectedTutorial: TutorialModes.Manual })).toMatchSnapshot(
'manual tutorial'
projectBinding: mockProjectBitbucketBindingResponse()
})
).toMatchSnapshot('jenkins tutorial');
+ expect(
+ shallowRender({
+ selectedTutorial: TutorialModes.GitHubActions,
+ projectBinding: mockProjectGitLabBindingResponse()
+ })
+ ).toMatchSnapshot('github actions tutorial');
expect(
shallowRender({
selectedTutorial: TutorialModes.GitLabCI,
click(wrapper.find('button.tutorial-mode-manual'));
expect(onSelectTutorial).toHaveBeenLastCalledWith(TutorialModes.Manual);
+
+ click(wrapper.find('button.tutorial-mode-github'));
+ expect(onSelectTutorial).toHaveBeenLastCalledWith(TutorialModes.GitHubActions);
});
it('should allow mode selection for GitLab', () => {
// Jest Snapshot v1, https://goo.gl/fbAQLP
+exports[`should render correctly for azure 1`] = `
+<Fragment>
+ <div
+ className="tutorial-selection"
+ >
+ <header
+ className="spacer-top spacer-bottom padded"
+ >
+ <h1
+ className="text-center big-spacer-bottom"
+ >
+ onboarding.tutorial.choose_method
+ </h1>
+ </header>
+ <div
+ className="display-flex-justify-center"
+ >
+ <button
+ className="button button-huge display-flex-column spacer-left spacer-right azure-pipelines"
+ onClick={[Function]}
+ type="button"
+ >
+ <img
+ alt=""
+ height={80}
+ src="/images/alm/azure.svg"
+ />
+ <div
+ className="medium big-spacer-top"
+ >
+ onboarding.tutorial.choose_method.azure_pipelines
+ </div>
+ </button>
+ <button
+ className="button button-huge display-flex-column spacer-left spacer-right tutorial-mode-manual"
+ onClick={[Function]}
+ type="button"
+ >
+ <img
+ alt=""
+ height={80}
+ src="/images/sonarcloud/analysis/manual.svg"
+ />
+ <div
+ className="medium big-spacer-top"
+ >
+ onboarding.tutorial.choose_method.manual
+ </div>
+ </button>
+ </div>
+ </div>
+</Fragment>
+`;
+
+exports[`should render correctly for bitbucket server 1`] = `
+<Fragment>
+ <div
+ className="tutorial-selection"
+ >
+ <header
+ className="spacer-top spacer-bottom padded"
+ >
+ <h1
+ className="text-center big-spacer-bottom"
+ >
+ onboarding.tutorial.choose_method
+ </h1>
+ </header>
+ <div
+ className="display-flex-justify-center"
+ >
+ <button
+ className="button button-huge display-flex-column spacer-left spacer-right tutorial-mode-jenkins"
+ onClick={[Function]}
+ type="button"
+ >
+ <img
+ alt=""
+ height={80}
+ src="/images/tutorials/jenkins.svg"
+ />
+ <div
+ className="medium big-spacer-top"
+ >
+ onboarding.tutorial.choose_method.jenkins
+ </div>
+ </button>
+ <button
+ className="button button-huge display-flex-column spacer-left spacer-right tutorial-mode-manual"
+ onClick={[Function]}
+ type="button"
+ >
+ <img
+ alt=""
+ height={80}
+ src="/images/sonarcloud/analysis/manual.svg"
+ />
+ <div
+ className="medium big-spacer-top"
+ >
+ onboarding.tutorial.choose_method.manual
+ </div>
+ </button>
+ </div>
+ </div>
+</Fragment>
+`;
+
+exports[`should render correctly for github 1`] = `
+<Fragment>
+ <div
+ className="tutorial-selection"
+ >
+ <header
+ className="spacer-top spacer-bottom padded"
+ >
+ <h1
+ className="text-center big-spacer-bottom"
+ >
+ onboarding.tutorial.choose_method
+ </h1>
+ </header>
+ <div
+ className="display-flex-justify-center"
+ >
+ <button
+ className="button button-huge display-flex-column spacer-left spacer-right tutorial-mode-github"
+ onClick={[Function]}
+ type="button"
+ >
+ <img
+ alt=""
+ className="spacer-bottom spacer-top"
+ height={64}
+ src="/images/tutorials/github-actions.svg"
+ />
+ <div
+ className="medium big-spacer-top"
+ >
+ onboarding.tutorial.choose_method.github_action
+ </div>
+ </button>
+ <button
+ className="button button-huge display-flex-column spacer-left spacer-right tutorial-mode-jenkins"
+ onClick={[Function]}
+ type="button"
+ >
+ <img
+ alt=""
+ height={80}
+ src="/images/tutorials/jenkins.svg"
+ />
+ <div
+ className="medium big-spacer-top"
+ >
+ onboarding.tutorial.choose_method.jenkins
+ </div>
+ </button>
+ <button
+ className="button button-huge display-flex-column spacer-left spacer-right tutorial-mode-manual"
+ onClick={[Function]}
+ type="button"
+ >
+ <img
+ alt=""
+ height={80}
+ src="/images/sonarcloud/analysis/manual.svg"
+ />
+ <div
+ className="medium big-spacer-top"
+ >
+ onboarding.tutorial.choose_method.manual
+ </div>
+ </button>
+ </div>
+ </div>
+</Fragment>
+`;
+
+exports[`should render correctly for gitlab 1`] = `
+<Fragment>
+ <div
+ className="tutorial-selection"
+ >
+ <header
+ className="spacer-top spacer-bottom padded"
+ >
+ <h1
+ className="text-center big-spacer-bottom"
+ >
+ onboarding.tutorial.choose_method
+ </h1>
+ </header>
+ <div
+ className="display-flex-justify-center"
+ >
+ <button
+ className="button button-huge display-flex-column spacer-left spacer-right tutorial-mode-gitlab"
+ onClick={[Function]}
+ type="button"
+ >
+ <img
+ alt=""
+ height={80}
+ src="/images/alm/gitlab.svg"
+ />
+ <div
+ className="medium big-spacer-top"
+ >
+ onboarding.tutorial.choose_method.gitlab_ci
+ </div>
+ </button>
+ <button
+ className="button button-huge display-flex-column spacer-left spacer-right tutorial-mode-jenkins"
+ onClick={[Function]}
+ type="button"
+ >
+ <img
+ alt=""
+ height={80}
+ src="/images/tutorials/jenkins.svg"
+ />
+ <div
+ className="medium big-spacer-top"
+ >
+ onboarding.tutorial.choose_method.jenkins
+ </div>
+ </button>
+ <button
+ className="button button-huge display-flex-column spacer-left spacer-right tutorial-mode-manual"
+ onClick={[Function]}
+ type="button"
+ >
+ <img
+ alt=""
+ height={80}
+ src="/images/sonarcloud/analysis/manual.svg"
+ />
+ <div
+ className="medium big-spacer-top"
+ >
+ onboarding.tutorial.choose_method.manual
+ </div>
+ </button>
+ </div>
+ </div>
+</Fragment>
+`;
+
exports[`should render correctly: azure pipelines tutorial 1`] = `
<Fragment>
<AzurePipelinesTutorial
</Fragment>
`;
+exports[`should render correctly: github actions tutorial 1`] = `
+<Fragment>
+ <GitHubActionTutorial
+ baseUrl="http://localhost:9000"
+ component={
+ Object {
+ "breadcrumbs": Array [],
+ "key": "my-project",
+ "name": "MyProject",
+ "qualifier": "TRK",
+ "qualityGate": Object {
+ "isDefault": true,
+ "key": "30",
+ "name": "Sonar way",
+ },
+ "qualityProfiles": Array [
+ Object {
+ "deleted": false,
+ "key": "my-qp",
+ "language": "ts",
+ "name": "Sonar way",
+ },
+ ],
+ "tags": Array [],
+ }
+ }
+ currentUser={
+ Object {
+ "groups": Array [],
+ "isLoggedIn": true,
+ "login": "luke",
+ "name": "Skywalker",
+ "scmAccounts": Array [],
+ }
+ }
+ projectBinding={
+ Object {
+ "alm": "gitlab",
+ "key": "foo",
+ "monorepo": true,
+ "repository": "PROJECT_KEY",
+ "url": "https://gitlab.com/api/v4",
+ }
+ }
+ />
+</Fragment>
+`;
+
exports[`should render correctly: gitlab tutorial 1`] = `
<Fragment>
<GitLabCITutorial
</div>
</Fragment>
`;
-
-exports[`should render correctly: selection with jenkins available 1`] = `
-<Fragment>
- <div
- className="tutorial-selection"
- >
- <header
- className="spacer-top spacer-bottom padded"
- >
- <h1
- className="text-center big-spacer-bottom"
- >
- onboarding.tutorial.choose_method
- </h1>
- </header>
- <div
- className="display-flex-justify-center"
- >
- <button
- className="button button-huge display-flex-column spacer-left spacer-right tutorial-mode-jenkins"
- onClick={[Function]}
- type="button"
- >
- <img
- alt=""
- height={80}
- src="/images/tutorials/jenkins.svg"
- />
- <div
- className="medium big-spacer-top"
- >
- onboarding.tutorial.choose_method.jenkins
- </div>
- </button>
- <button
- className="button button-huge display-flex-column spacer-left spacer-right tutorial-mode-manual"
- onClick={[Function]}
- type="button"
- >
- <img
- alt=""
- height={80}
- src="/images/sonarcloud/analysis/manual.svg"
- />
- <div
- className="medium big-spacer-top"
- >
- onboarding.tutorial.choose_method.manual
- </div>
- </button>
- </div>
- </div>
-</Fragment>
-`;
--- /dev/null
+/*
+ * SonarQube
+ * Copyright (C) 2009-2021 SonarSource SA
+ * mailto:info AT sonarsource DOT com
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 3 of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this program; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ */
+import * as React from 'react';
+import { translate } from 'sonar-ui-common/helpers/l10n';
+import { getBaseUrl } from 'sonar-ui-common/helpers/urls';
+import { withAppState } from '../../hoc/withAppState';
+import SentenceWithHighlights from './SentenceWithHighlights';
+
+export interface AllSetProps {
+ appState: T.AppState;
+}
+
+export function AllSet(props: AllSetProps) {
+ const {
+ appState: { branchesEnabled }
+ } = props;
+
+ return (
+ <div className="abs-width-600">
+ <p className="big-spacer-bottom">
+ <SentenceWithHighlights
+ highlightKeys={['all_set']}
+ translationKey="onboarding.tutorial.ci_outro.all_set"
+ />
+ </p>
+ <div className="display-flex-row big-spacer-bottom">
+ <div>
+ <img
+ alt="" // Should be ignored by screen readers
+ className="big-spacer-right"
+ width={30}
+ src={`${getBaseUrl()}/images/tutorials/commit.svg`}
+ />
+ </div>
+ <div>
+ <p className="little-spacer-bottom">
+ <strong>{translate('onboarding.tutorial.ci_outro.commit')}</strong>
+ </p>
+ <p>
+ {branchesEnabled
+ ? translate('onboarding.tutorial.ci_outro.commit.why')
+ : translate('onboarding.tutorial.ci_outro.commit.why.no_branches')}
+ </p>
+ </div>
+ </div>
+ <div className="display-flex-row huge-spacer-bottom">
+ <div>
+ <img
+ alt="" // Should be ignored by screen readers
+ className="big-spacer-right"
+ width={30}
+ src={`${getBaseUrl()}/images/tutorials/refresh.svg`}
+ />
+ </div>
+ <div>
+ <p className="little-spacer-bottom">
+ <strong>{translate('onboarding.tutorial.ci_outro.refresh')}</strong>
+ </p>
+ <p>{translate('onboarding.tutorial.ci_outro.refresh.why')}</p>
+ </div>
+ </div>
+ </div>
+ );
+}
+
+export default withAppState(AllSet);
--- /dev/null
+/*
+ * SonarQube
+ * Copyright (C) 2009-2021 SonarSource SA
+ * mailto:info AT sonarsource DOT com
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 3 of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this program; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ */
+import * as React from 'react';
+import CodeSnippet from '../../common/CodeSnippet';
+import SentenceWithFilename from './SentenceWithFilename';
+
+export interface DefaultProjectKeyProps {
+ component: T.Component;
+}
+
+const sonarProjectSnippet = (key: string) => `sonar.projectKey=${key}`;
+
+export default function DefaultProjectKey(props: DefaultProjectKeyProps) {
+ const { component } = props;
+ return (
+ <li className="abs-width-600">
+ <SentenceWithFilename
+ filename="sonar-project.properties"
+ translationKey="onboarding.tutorial.other.project_key"
+ />
+ <CodeSnippet snippet={sonarProjectSnippet(component.key)} />
+ </li>
+ );
+}
--- /dev/null
+/*
+ * SonarQube
+ * Copyright (C) 2009-2021 SonarSource SA
+ * mailto:info AT sonarsource DOT com
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 3 of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this program; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ */
+import * as React from 'react';
+import { FormattedMessage } from 'react-intl';
+import { Button } from 'sonar-ui-common/components/controls/buttons';
+import { translate } from 'sonar-ui-common/helpers/l10n';
+import EditTokenModal from './EditTokenModal';
+
+export interface TokenStepGeneratorProps {
+ component: T.Component;
+ currentUser: T.LoggedInUser;
+}
+
+export default function TokenStepGenerator(props: TokenStepGeneratorProps) {
+ const { component, currentUser } = props;
+ const [isModalVisible, toggleModal] = React.useState(false);
+
+ const toggleTokenModal = () => toggleModal(visible => !visible);
+ const closeTokenModal = () => toggleModal(false);
+
+ return (
+ <>
+ <li className="big-spacer-bottom">
+ <FormattedMessage
+ defaultMessage={translate('onboarding.tutorial.env_variables')}
+ id="onboarding.tutorial.env_variables"
+ values={{
+ extra: (
+ <Button className="spacer-left" onClick={toggleTokenModal}>
+ {translate('onboarding.token.generate_token')}
+ </Button>
+ ),
+ field: <strong>{translate('onboarding.tutorial.env_variables.field')}</strong>,
+ value: translate('onboarding.tutorial.env_variables.token_generator.value')
+ }}
+ />
+ </li>
+ {isModalVisible && (
+ <EditTokenModal component={component} currentUser={currentUser} onClose={closeTokenModal} />
+ )}
+ </>
+ );
+}
--- /dev/null
+/*
+ * SonarQube
+ * Copyright (C) 2009-2021 SonarSource SA
+ * mailto:info AT sonarsource DOT com
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 3 of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this program; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ */
+import { shallow } from 'enzyme';
+import * as React from 'react';
+import { mockAppState } from '../../../../helpers/testMocks';
+import { AllSet, AllSetProps } from '../AllSet';
+
+it('should render correctly', () => {
+ expect(shallowRender()).toMatchSnapshot();
+ expect(shallowRender({ appState: mockAppState({ branchesEnabled: false }) })).toMatchSnapshot(
+ 'without branch'
+ );
+});
+
+function shallowRender(props: Partial<AllSetProps> = {}) {
+ return shallow<AllSetProps>(<AllSet appState={mockAppState()} {...props} />);
+}
--- /dev/null
+/*
+ * SonarQube
+ * Copyright (C) 2009-2021 SonarSource SA
+ * mailto:info AT sonarsource DOT com
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 3 of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this program; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ */
+import { shallow } from 'enzyme';
+import * as React from 'react';
+import { mockComponent } from '../../../../helpers/testMocks';
+import DefaultProjectKey, { DefaultProjectKeyProps } from '../DefaultProjectKey';
+
+it('should render correctly', () => {
+ expect(shallowRender()).toMatchSnapshot();
+});
+
+function shallowRender(props: Partial<DefaultProjectKeyProps> = {}) {
+ return shallow<DefaultProjectKeyProps>(
+ <DefaultProjectKey component={mockComponent()} {...props} />
+ );
+}
--- /dev/null
+/*
+ * SonarQube
+ * Copyright (C) 2009-2021 SonarSource SA
+ * mailto:info AT sonarsource DOT com
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 3 of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this program; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ */
+import { shallow } from 'enzyme';
+import * as React from 'react';
+import { mockComponent, mockLoggedInUser } from '../../../../helpers/testMocks';
+import TokenStepGenerator, { TokenStepGeneratorProps } from '../TokenStepGenerator';
+
+it('should render correctly', () => {
+ expect(shallowRender()).toMatchSnapshot();
+});
+
+function shallowRender(props: Partial<TokenStepGeneratorProps> = {}) {
+ return shallow<TokenStepGeneratorProps>(
+ <TokenStepGenerator component={mockComponent()} currentUser={mockLoggedInUser()} {...props} />
+ );
+}
--- /dev/null
+// Jest Snapshot v1, https://goo.gl/fbAQLP
+
+exports[`should render correctly 1`] = `
+<div
+ className="abs-width-600"
+>
+ <p
+ className="big-spacer-bottom"
+ >
+ <SentenceWithHighlights
+ highlightKeys={
+ Array [
+ "all_set",
+ ]
+ }
+ translationKey="onboarding.tutorial.ci_outro.all_set"
+ />
+ </p>
+ <div
+ className="display-flex-row big-spacer-bottom"
+ >
+ <div>
+ <img
+ alt=""
+ className="big-spacer-right"
+ src="/images/tutorials/commit.svg"
+ width={30}
+ />
+ </div>
+ <div>
+ <p
+ className="little-spacer-bottom"
+ >
+ <strong>
+ onboarding.tutorial.ci_outro.commit
+ </strong>
+ </p>
+ <p>
+ onboarding.tutorial.ci_outro.commit.why.no_branches
+ </p>
+ </div>
+ </div>
+ <div
+ className="display-flex-row huge-spacer-bottom"
+ >
+ <div>
+ <img
+ alt=""
+ className="big-spacer-right"
+ src="/images/tutorials/refresh.svg"
+ width={30}
+ />
+ </div>
+ <div>
+ <p
+ className="little-spacer-bottom"
+ >
+ <strong>
+ onboarding.tutorial.ci_outro.refresh
+ </strong>
+ </p>
+ <p>
+ onboarding.tutorial.ci_outro.refresh.why
+ </p>
+ </div>
+ </div>
+</div>
+`;
+
+exports[`should render correctly: without branch 1`] = `
+<div
+ className="abs-width-600"
+>
+ <p
+ className="big-spacer-bottom"
+ >
+ <SentenceWithHighlights
+ highlightKeys={
+ Array [
+ "all_set",
+ ]
+ }
+ translationKey="onboarding.tutorial.ci_outro.all_set"
+ />
+ </p>
+ <div
+ className="display-flex-row big-spacer-bottom"
+ >
+ <div>
+ <img
+ alt=""
+ className="big-spacer-right"
+ src="/images/tutorials/commit.svg"
+ width={30}
+ />
+ </div>
+ <div>
+ <p
+ className="little-spacer-bottom"
+ >
+ <strong>
+ onboarding.tutorial.ci_outro.commit
+ </strong>
+ </p>
+ <p>
+ onboarding.tutorial.ci_outro.commit.why.no_branches
+ </p>
+ </div>
+ </div>
+ <div
+ className="display-flex-row huge-spacer-bottom"
+ >
+ <div>
+ <img
+ alt=""
+ className="big-spacer-right"
+ src="/images/tutorials/refresh.svg"
+ width={30}
+ />
+ </div>
+ <div>
+ <p
+ className="little-spacer-bottom"
+ >
+ <strong>
+ onboarding.tutorial.ci_outro.refresh
+ </strong>
+ </p>
+ <p>
+ onboarding.tutorial.ci_outro.refresh.why
+ </p>
+ </div>
+ </div>
+</div>
+`;
--- /dev/null
+// Jest Snapshot v1, https://goo.gl/fbAQLP
+
+exports[`should render correctly 1`] = `
+<li
+ className="abs-width-600"
+>
+ <SentenceWithFilename
+ filename="sonar-project.properties"
+ translationKey="onboarding.tutorial.other.project_key"
+ />
+ <CodeSnippet
+ snippet="sonar.projectKey=my-project"
+ />
+</li>
+`;
--- /dev/null
+// Jest Snapshot v1, https://goo.gl/fbAQLP
+
+exports[`should render correctly 1`] = `
+<Fragment>
+ <li
+ className="big-spacer-bottom"
+ >
+ <FormattedMessage
+ defaultMessage="onboarding.tutorial.env_variables"
+ id="onboarding.tutorial.env_variables"
+ values={
+ Object {
+ "extra": <Button
+ className="spacer-left"
+ onClick={[Function]}
+ >
+ onboarding.token.generate_token
+ </Button>,
+ "field": <strong>
+ onboarding.tutorial.env_variables.field
+ </strong>,
+ "value": "onboarding.tutorial.env_variables.token_generator.value",
+ }
+ }
+ />
+ </li>
+</Fragment>
+`;
--- /dev/null
+/*
+ * SonarQube
+ * Copyright (C) 2009-2021 SonarSource SA
+ * mailto:info AT sonarsource DOT com
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 3 of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this program; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ */
+import * as React from 'react';
+import { withAppState } from '../../hoc/withAppState';
+import { BuildTools } from '../types';
+import DotNet from './commands/DotNet';
+import Gradle from './commands/Gradle';
+import JavaMaven from './commands/JavaMaven';
+import Others from './commands/Others';
+
+export interface AnalysisCommandProps {
+ appState: T.AppState;
+ buildTool?: BuildTools;
+ component: T.Component;
+}
+
+export function AnalysisCommand(props: AnalysisCommandProps) {
+ const {
+ buildTool,
+ component,
+ appState: { branchesEnabled }
+ } = props;
+
+ if (!buildTool) {
+ return null;
+ }
+
+ switch (buildTool) {
+ case BuildTools.Maven:
+ return <JavaMaven branchesEnabled={branchesEnabled} component={component} />;
+ case BuildTools.Gradle:
+ return <Gradle branchesEnabled={branchesEnabled} component={component} />;
+ case BuildTools.DotNet:
+ return <DotNet branchesEnabled={branchesEnabled} component={component} />;
+ case BuildTools.Other:
+ return <Others branchesEnabled={branchesEnabled} component={component} />;
+ }
+ return null;
+}
+
+export default withAppState(AnalysisCommand);
--- /dev/null
+/*
+ * SonarQube
+ * Copyright (C) 2009-2021 SonarSource SA
+ * mailto:info AT sonarsource DOT com
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 3 of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this program; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ */
+import * as React from 'react';
+import { translate } from 'sonar-ui-common/helpers/l10n';
+import { ProjectAlmBindingResponse } from '../../../types/alm-settings';
+import Step from '../components/Step';
+import SecretStep from './SecretStep';
+import YamlFileStep from './YamlFileStep';
+
+export enum Steps {
+ CREATE_SECRET = 1,
+ YAML = 2
+}
+
+export interface GitHubActionTutorialProps {
+ baseUrl: string;
+ component: T.Component;
+ currentUser: T.LoggedInUser;
+ projectBinding: ProjectAlmBindingResponse;
+}
+
+export default function GitHubActionTutorial(props: GitHubActionTutorialProps) {
+ const { baseUrl, currentUser, component, projectBinding } = props;
+
+ const [step, setStep] = React.useState<Steps>(Steps.CREATE_SECRET);
+ return (
+ <>
+ <Step
+ finished={step > Steps.CREATE_SECRET}
+ onOpen={() => setStep(Steps.CREATE_SECRET)}
+ open={step === Steps.CREATE_SECRET}
+ renderForm={() => (
+ <SecretStep
+ baseUrl={baseUrl}
+ component={component}
+ currentUser={currentUser}
+ projectBinding={projectBinding}
+ onDone={() => setStep(Steps.YAML)}
+ />
+ )}
+ stepNumber={Steps.CREATE_SECRET}
+ stepTitle={translate('onboarding.tutorial.with.github_action.create_secret.title')}
+ />
+ <Step
+ onOpen={() => setStep(Steps.YAML)}
+ open={step === Steps.YAML}
+ renderForm={() => <YamlFileStep component={component} />}
+ stepNumber={Steps.YAML}
+ stepTitle={translate('onboarding.tutorial.with.github_action.yaml.title')}
+ />
+ </>
+ );
+}
--- /dev/null
+/*
+ * SonarQube
+ * Copyright (C) 2009-2021 SonarSource SA
+ * mailto:info AT sonarsource DOT com
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 3 of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this program; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ */
+import * as React from 'react';
+import { FormattedMessage } from 'react-intl';
+import { Button } from 'sonar-ui-common/components/controls/buttons';
+import { ClipboardIconButton } from 'sonar-ui-common/components/controls/clipboard';
+import { translate } from 'sonar-ui-common/helpers/l10n';
+import { ProjectAlmBindingResponse } from '../../../types/alm-settings';
+import SentenceWithHighlights from '../components/SentenceWithHighlights';
+import TokenStepGenerator from '../components/TokenStepGenerator';
+
+export interface SecretStepProps {
+ baseUrl: string;
+ component: T.Component;
+ currentUser: T.LoggedInUser;
+ projectBinding: ProjectAlmBindingResponse;
+ onDone: () => void;
+}
+
+export default function SecretStep(props: SecretStepProps) {
+ const {
+ baseUrl,
+ component,
+ currentUser,
+ projectBinding: { repository }
+ } = props;
+
+ return (
+ <div className="boxed-group-inner">
+ <p className="big-spacer-bottom">
+ <FormattedMessage
+ defaultMessage={translate('onboarding.tutorial.with.github_action.secret.intro')}
+ id="onboarding.tutorial.with.github_action.secret.intro"
+ values={{
+ settings_secret: repository ? (
+ <a
+ href={`https://github.com/${repository}/settings/secrets`}
+ target="_blank"
+ rel="noopener noreferrer">
+ {translate('onboarding.tutorial.with.github_action.secret.intro.link')}
+ </a>
+ ) : (
+ translate('onboarding.tutorial.with.github_action.secret.intro.link')
+ )
+ }}
+ />
+ </p>
+ <ol className="list-styled">
+ <li>
+ <SentenceWithHighlights
+ translationKey="onboarding.tutorial.with.github_action.secret.new"
+ highlightKeys={['new_secret']}
+ />
+ </li>
+ <li>
+ <SentenceWithHighlights
+ translationKey="onboarding.tutorial.with.github_action.secret.name"
+ highlightKeys={['name']}
+ />
+ <code className="rule little-spacer-left">SONAR_TOKEN</code>
+ <ClipboardIconButton copyValue="SONAR_TOKEN" />
+ </li>
+ <TokenStepGenerator component={component} currentUser={currentUser} />
+ <li>
+ <SentenceWithHighlights
+ translationKey="onboarding.tutorial.with.github_action.secret.add"
+ highlightKeys={['add_secret']}
+ />
+ </li>
+ </ol>
+
+ <hr className="no-horizontal-margins" />
+
+ <ol className="list-styled big-spacer-top big-spacer-bottom">
+ <li>
+ <SentenceWithHighlights
+ translationKey="onboarding.tutorial.with.github_action.secret.new"
+ highlightKeys={['new_secret']}
+ />
+ </li>
+ <li>
+ <SentenceWithHighlights
+ translationKey="onboarding.tutorial.with.github_action.secret.name"
+ highlightKeys={['name']}
+ />
+
+ <code className="rule little-spacer-left">SONAR_HOST_URL</code>
+ <ClipboardIconButton copyValue="SONAR_HOST_URL" />
+ </li>
+ <li className="big-spacer-bottom">
+ <FormattedMessage
+ defaultMessage={translate('onboarding.tutorial.env_variables')}
+ id="onboarding.tutorial.env_variables"
+ values={{
+ extra: <ClipboardIconButton copyValue={baseUrl} />,
+ field: <strong>{translate('onboarding.tutorial.env_variables.field')}</strong>,
+ value: <code className="rule">{baseUrl}</code>
+ }}
+ />
+ </li>
+ <li>
+ <SentenceWithHighlights
+ translationKey="onboarding.tutorial.with.github_action.secret.add"
+ highlightKeys={['add_secret']}
+ />
+ </li>
+ </ol>
+ <Button onClick={props.onDone}>{translate('continue')}</Button>
+ </div>
+ );
+}
--- /dev/null
+/*
+ * SonarQube
+ * Copyright (C) 2009-2021 SonarSource SA
+ * mailto:info AT sonarsource DOT com
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 3 of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this program; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ */
+import * as React from 'react';
+import { translate } from 'sonar-ui-common/helpers/l10n';
+import AllSet from '../components/AllSet';
+import RenderOptions from '../components/RenderOptions';
+import { BuildTools } from '../types';
+import AnalysisCommand from './AnalysisCommand';
+
+export interface YamlFileStepProps {
+ component: T.Component;
+}
+
+export default function YamlFileStep(props: YamlFileStepProps) {
+ const { component } = props;
+ const buildTools = [BuildTools.Maven, BuildTools.Gradle, BuildTools.DotNet, BuildTools.Other];
+ const [buildToolSelected, setBuildToolSelected] = React.useState<BuildTools>();
+
+ return (
+ <>
+ <ol className="list-styled big-spacer-top big-spacer-bottom">
+ <li>
+ {translate('onboarding.build')}
+
+ <RenderOptions
+ checked={buildToolSelected}
+ name="language"
+ onCheck={value => setBuildToolSelected(value as BuildTools)}
+ options={buildTools}
+ optionLabelKey="onboarding.build"
+ />
+ </li>
+ <AnalysisCommand buildTool={buildToolSelected} component={component} />
+ </ol>
+ {buildToolSelected !== undefined && (
+ <>
+ <hr className="huge-spacer-top huge-spacer-bottom" />
+ <AllSet />
+ </>
+ )}
+ </>
+ );
+}
--- /dev/null
+/*
+ * SonarQube
+ * Copyright (C) 2009-2021 SonarSource SA
+ * mailto:info AT sonarsource DOT com
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 3 of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this program; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ */
+import { shallow } from 'enzyme';
+import * as React from 'react';
+import { mockAppState, mockComponent } from '../../../../helpers/testMocks';
+import { BuildTools } from '../../types';
+import { AnalysisCommand, AnalysisCommandProps } from '../AnalysisCommand';
+
+it.each([
+ undefined,
+ BuildTools.CFamily,
+ BuildTools.DotNet,
+ BuildTools.Gradle,
+ BuildTools.Maven,
+ BuildTools.Other
+])('should render correctly for %p', buildTool => {
+ expect(shallowRender({ buildTool })).toMatchSnapshot();
+});
+
+function shallowRender(props: Partial<AnalysisCommandProps> = {}) {
+ return shallow<AnalysisCommandProps>(
+ <AnalysisCommand appState={mockAppState()} component={mockComponent()} {...props} />
+ );
+}
--- /dev/null
+/*
+ * SonarQube
+ * Copyright (C) 2009-2021 SonarSource SA
+ * mailto:info AT sonarsource DOT com
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 3 of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this program; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ */
+import { shallow } from 'enzyme';
+import * as React from 'react';
+import { mockProjectGithubBindingResponse } from '../../../../helpers/mocks/alm-settings';
+import { mockComponent, mockLoggedInUser } from '../../../../helpers/testMocks';
+import Step from '../../components/Step';
+import GitHubActionTutorial, { GitHubActionTutorialProps } from '../GitHubActionTutorial';
+
+it('should render correctly', () => {
+ const wrapper = shallowRender();
+ expect(wrapper).toMatchSnapshot('For secret steps');
+ const stepYaml = wrapper.find(Step).at(1);
+ stepYaml.simulate('open');
+ expect(wrapper).toMatchSnapshot('For yaml steps');
+});
+
+function shallowRender(props: Partial<GitHubActionTutorialProps> = {}) {
+ return shallow<GitHubActionTutorialProps>(
+ <GitHubActionTutorial
+ baseUrl="test"
+ currentUser={mockLoggedInUser()}
+ component={mockComponent()}
+ projectBinding={mockProjectGithubBindingResponse()}
+ {...props}
+ />
+ );
+}
--- /dev/null
+/*
+ * SonarQube
+ * Copyright (C) 2009-2021 SonarSource SA
+ * mailto:info AT sonarsource DOT com
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 3 of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this program; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ */
+import { shallow } from 'enzyme';
+import * as React from 'react';
+import { mockProjectGithubBindingResponse } from '../../../../helpers/mocks/alm-settings';
+import { mockComponent, mockLoggedInUser } from '../../../../helpers/testMocks';
+import SecretStep, { SecretStepProps } from '../SecretStep';
+
+it('should render correctly', () => {
+ expect(shallowRender()).toMatchSnapshot();
+});
+
+function shallowRender(props: Partial<SecretStepProps> = {}) {
+ return shallow<SecretStepProps>(
+ <SecretStep
+ baseUrl="test"
+ component={mockComponent()}
+ currentUser={mockLoggedInUser()}
+ projectBinding={mockProjectGithubBindingResponse()}
+ onDone={jest.fn()}
+ {...props}
+ />
+ );
+}
--- /dev/null
+/*
+ * SonarQube
+ * Copyright (C) 2009-2021 SonarSource SA
+ * mailto:info AT sonarsource DOT com
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 3 of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this program; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ */
+import { shallow } from 'enzyme';
+import * as React from 'react';
+import { mockComponent } from '../../../../helpers/testMocks';
+import YamlFileStep, { YamlFileStepProps } from '../YamlFileStep';
+
+it('should render correctly', () => {
+ expect(shallowRender()).toMatchSnapshot();
+});
+
+function shallowRender(props: Partial<YamlFileStepProps> = {}) {
+ return shallow<YamlFileStepProps>(<YamlFileStep component={mockComponent()} {...props} />);
+}
--- /dev/null
+// Jest Snapshot v1, https://goo.gl/fbAQLP
+
+exports[`should render correctly for "cfamily" 1`] = `""`;
+
+exports[`should render correctly for "dotnet" 1`] = `
+<DotNet
+ component={
+ Object {
+ "breadcrumbs": Array [],
+ "key": "my-project",
+ "name": "MyProject",
+ "qualifier": "TRK",
+ "qualityGate": Object {
+ "isDefault": true,
+ "key": "30",
+ "name": "Sonar way",
+ },
+ "qualityProfiles": Array [
+ Object {
+ "deleted": false,
+ "key": "my-qp",
+ "language": "ts",
+ "name": "Sonar way",
+ },
+ ],
+ "tags": Array [],
+ }
+ }
+/>
+`;
+
+exports[`should render correctly for "gradle" 1`] = `
+<Gradle
+ component={
+ Object {
+ "breadcrumbs": Array [],
+ "key": "my-project",
+ "name": "MyProject",
+ "qualifier": "TRK",
+ "qualityGate": Object {
+ "isDefault": true,
+ "key": "30",
+ "name": "Sonar way",
+ },
+ "qualityProfiles": Array [
+ Object {
+ "deleted": false,
+ "key": "my-qp",
+ "language": "ts",
+ "name": "Sonar way",
+ },
+ ],
+ "tags": Array [],
+ }
+ }
+/>
+`;
+
+exports[`should render correctly for "maven" 1`] = `
+<JavaMaven
+ component={
+ Object {
+ "breadcrumbs": Array [],
+ "key": "my-project",
+ "name": "MyProject",
+ "qualifier": "TRK",
+ "qualityGate": Object {
+ "isDefault": true,
+ "key": "30",
+ "name": "Sonar way",
+ },
+ "qualityProfiles": Array [
+ Object {
+ "deleted": false,
+ "key": "my-qp",
+ "language": "ts",
+ "name": "Sonar way",
+ },
+ ],
+ "tags": Array [],
+ }
+ }
+/>
+`;
+
+exports[`should render correctly for "other" 1`] = `
+<Others
+ component={
+ Object {
+ "breadcrumbs": Array [],
+ "key": "my-project",
+ "name": "MyProject",
+ "qualifier": "TRK",
+ "qualityGate": Object {
+ "isDefault": true,
+ "key": "30",
+ "name": "Sonar way",
+ },
+ "qualityProfiles": Array [
+ Object {
+ "deleted": false,
+ "key": "my-qp",
+ "language": "ts",
+ "name": "Sonar way",
+ },
+ ],
+ "tags": Array [],
+ }
+ }
+/>
+`;
+
+exports[`should render correctly for undefined 1`] = `""`;
--- /dev/null
+// Jest Snapshot v1, https://goo.gl/fbAQLP
+
+exports[`should render correctly: For secret steps 1`] = `
+<Fragment>
+ <Step
+ finished={false}
+ onOpen={[Function]}
+ open={true}
+ renderForm={[Function]}
+ stepNumber={1}
+ stepTitle="onboarding.tutorial.with.github_action.create_secret.title"
+ />
+ <Step
+ onOpen={[Function]}
+ open={false}
+ renderForm={[Function]}
+ stepNumber={2}
+ stepTitle="onboarding.tutorial.with.github_action.yaml.title"
+ />
+</Fragment>
+`;
+
+exports[`should render correctly: For yaml steps 1`] = `
+<Fragment>
+ <Step
+ finished={true}
+ onOpen={[Function]}
+ open={false}
+ renderForm={[Function]}
+ stepNumber={1}
+ stepTitle="onboarding.tutorial.with.github_action.create_secret.title"
+ />
+ <Step
+ onOpen={[Function]}
+ open={true}
+ renderForm={[Function]}
+ stepNumber={2}
+ stepTitle="onboarding.tutorial.with.github_action.yaml.title"
+ />
+</Fragment>
+`;
--- /dev/null
+// Jest Snapshot v1, https://goo.gl/fbAQLP
+
+exports[`should render correctly 1`] = `
+<div
+ className="boxed-group-inner"
+>
+ <p
+ className="big-spacer-bottom"
+ >
+ <FormattedMessage
+ defaultMessage="onboarding.tutorial.with.github_action.secret.intro"
+ id="onboarding.tutorial.with.github_action.secret.intro"
+ values={
+ Object {
+ "settings_secret": <a
+ href="https://github.com/PROJECT_KEY/settings/secrets"
+ rel="noopener noreferrer"
+ target="_blank"
+ >
+ onboarding.tutorial.with.github_action.secret.intro.link
+ </a>,
+ }
+ }
+ />
+ </p>
+ <ol
+ className="list-styled"
+ >
+ <li>
+ <SentenceWithHighlights
+ highlightKeys={
+ Array [
+ "new_secret",
+ ]
+ }
+ translationKey="onboarding.tutorial.with.github_action.secret.new"
+ />
+ </li>
+ <li>
+ <SentenceWithHighlights
+ highlightKeys={
+ Array [
+ "name",
+ ]
+ }
+ translationKey="onboarding.tutorial.with.github_action.secret.name"
+ />
+ <code
+ className="rule little-spacer-left"
+ >
+ SONAR_TOKEN
+ </code>
+ <ClipboardIconButton
+ copyValue="SONAR_TOKEN"
+ />
+ </li>
+ <TokenStepGenerator
+ component={
+ Object {
+ "breadcrumbs": Array [],
+ "key": "my-project",
+ "name": "MyProject",
+ "qualifier": "TRK",
+ "qualityGate": Object {
+ "isDefault": true,
+ "key": "30",
+ "name": "Sonar way",
+ },
+ "qualityProfiles": Array [
+ Object {
+ "deleted": false,
+ "key": "my-qp",
+ "language": "ts",
+ "name": "Sonar way",
+ },
+ ],
+ "tags": Array [],
+ }
+ }
+ currentUser={
+ Object {
+ "groups": Array [],
+ "isLoggedIn": true,
+ "login": "luke",
+ "name": "Skywalker",
+ "scmAccounts": Array [],
+ }
+ }
+ />
+ <li>
+ <SentenceWithHighlights
+ highlightKeys={
+ Array [
+ "add_secret",
+ ]
+ }
+ translationKey="onboarding.tutorial.with.github_action.secret.add"
+ />
+ </li>
+ </ol>
+ <hr
+ className="no-horizontal-margins"
+ />
+ <ol
+ className="list-styled big-spacer-top big-spacer-bottom"
+ >
+ <li>
+ <SentenceWithHighlights
+ highlightKeys={
+ Array [
+ "new_secret",
+ ]
+ }
+ translationKey="onboarding.tutorial.with.github_action.secret.new"
+ />
+ </li>
+ <li>
+ <SentenceWithHighlights
+ highlightKeys={
+ Array [
+ "name",
+ ]
+ }
+ translationKey="onboarding.tutorial.with.github_action.secret.name"
+ />
+ <code
+ className="rule little-spacer-left"
+ >
+ SONAR_HOST_URL
+ </code>
+ <ClipboardIconButton
+ copyValue="SONAR_HOST_URL"
+ />
+ </li>
+ <li
+ className="big-spacer-bottom"
+ >
+ <FormattedMessage
+ defaultMessage="onboarding.tutorial.env_variables"
+ id="onboarding.tutorial.env_variables"
+ values={
+ Object {
+ "extra": <ClipboardIconButton
+ copyValue="test"
+ />,
+ "field": <strong>
+ onboarding.tutorial.env_variables.field
+ </strong>,
+ "value": <code
+ className="rule"
+ >
+ test
+ </code>,
+ }
+ }
+ />
+ </li>
+ <li>
+ <SentenceWithHighlights
+ highlightKeys={
+ Array [
+ "add_secret",
+ ]
+ }
+ translationKey="onboarding.tutorial.with.github_action.secret.add"
+ />
+ </li>
+ </ol>
+ <Button
+ onClick={[MockFunction]}
+ >
+ continue
+ </Button>
+</div>
+`;
--- /dev/null
+// Jest Snapshot v1, https://goo.gl/fbAQLP
+
+exports[`should render correctly 1`] = `
+<Fragment>
+ <ol
+ className="list-styled big-spacer-top big-spacer-bottom"
+ >
+ <li>
+ onboarding.build
+ <RenderOptions
+ name="language"
+ onCheck={[Function]}
+ optionLabelKey="onboarding.build"
+ options={
+ Array [
+ "maven",
+ "gradle",
+ "dotnet",
+ "other",
+ ]
+ }
+ />
+ </li>
+ <Connect(withAppState(AnalysisCommand))
+ component={
+ Object {
+ "breadcrumbs": Array [],
+ "key": "my-project",
+ "name": "MyProject",
+ "qualifier": "TRK",
+ "qualityGate": Object {
+ "isDefault": true,
+ "key": "30",
+ "name": "Sonar way",
+ },
+ "qualityProfiles": Array [
+ Object {
+ "deleted": false,
+ "key": "my-qp",
+ "language": "ts",
+ "name": "Sonar way",
+ },
+ ],
+ "tags": Array [],
+ }
+ }
+ />
+ </ol>
+</Fragment>
+`;
--- /dev/null
+/*
+ * SonarQube
+ * Copyright (C) 2009-2021 SonarSource SA
+ * mailto:info AT sonarsource DOT com
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 3 of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this program; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ */
+import * as React from 'react';
+import { FormattedMessage } from 'react-intl';
+import { ClipboardIconButton } from 'sonar-ui-common/components/controls/clipboard';
+import { translate } from 'sonar-ui-common/helpers/l10n';
+import CodeSnippet from '../../../common/CodeSnippet';
+
+export interface CreateYmlFileProps {
+ yamlTemplate: string;
+}
+
+export default function CreateYmlFile(props: CreateYmlFileProps) {
+ const { yamlTemplate } = props;
+ return (
+ <li className="abs-width-800">
+ <FormattedMessage
+ defaultMessage={translate('onboarding.tutorial.with.github_action.yaml.create_yml')}
+ id="onboarding.tutorial.with.github_action.yaml.create_yml"
+ values={{
+ file: (
+ <>
+ <code className="rule">.github/workflows/build.yml</code>
+ <ClipboardIconButton copyValue=".github/workflows/build.yml" />
+ </>
+ )
+ }}
+ />
+ <CodeSnippet snippet={yamlTemplate} />
+ </li>
+ );
+}
--- /dev/null
+/*
+ * SonarQube
+ * Copyright (C) 2009-2021 SonarSource SA
+ * mailto:info AT sonarsource DOT com
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 3 of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this program; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ */
+import * as React from 'react';
+import CreateYmlFile from './CreateYmlFile';
+
+export interface DotNetProps {
+ branchesEnabled?: boolean;
+ component: T.Component;
+}
+
+const dotnetYamlTemplate = (projectKey: string, branchesEnabled: boolean) => `name: Build
+on:
+ push:
+ branches:
+ - master # or the name of your main branch
+${branchesEnabled ? ' pull_request:\n types: [opened, synchronize, reopened]' : ''}
+jobs:
+ build:
+ name: Build
+ runs-on: windows-latest
+ steps:
+ - name: Set up JDK 11
+ uses: actions/setup-java@v1
+ with:
+ java-version: 1.11
+ - uses: actions/checkout@v2
+ with:
+ fetch-depth: 0 # Shallow clones should be disabled for a better relevancy of analysis
+ - name: Cache SonarQube packages
+ uses: actions/cache@v1
+ with:
+ path: ~\\sonar\\cache
+ key: \${{ runner.os }}-sonar
+ restore-keys: \${{ runner.os }}-sonar
+ - name: Cache SonarQube scanner
+ id: cache-sonar-scanner
+ uses: actions/cache@v1
+ with:
+ path: .\\.sonar\\scanner
+ key: \${{ runner.os }}-sonar-scanner
+ restore-keys: \${{ runner.os }}-sonar-scanner
+ - name: Install SonarQube scanner
+ if: steps.cache-sonar-scanner.outputs.cache-hit != 'true'
+ shell: powershell
+ run: |
+ New-Item -Path .\\.sonar\\scanner -ItemType Directory
+ dotnet tool update dotnet-sonarscanner --tool-path .\\.sonar\\scanner
+ - name: Build and analyze
+ env:
+ GITHUB_TOKEN: \${{ secrets.GITHUB_TOKEN }} # Needed to get PR information, if any
+ shell: powershell
+ run: |
+ .\\.sonar\\scanner\\dotnet-sonarscanner begin /k:"${projectKey}" /d:sonar.login="\${{ secrets.SONAR_TOKEN }}" /d:sonar.host.url="\${{ secrets.SONAR_HOST_URL }}"
+ dotnet build
+ .\\.sonar\\scanner\\dotnet-sonarscanner end /d:sonar.login="\${{ secrets.SONAR_TOKEN }}"`;
+
+export default function DotNet(props: DotNetProps) {
+ const { component, branchesEnabled } = props;
+ return <CreateYmlFile yamlTemplate={dotnetYamlTemplate(component.key, !!branchesEnabled)} />;
+}
--- /dev/null
+/*
+ * SonarQube
+ * Copyright (C) 2009-2021 SonarSource SA
+ * mailto:info AT sonarsource DOT com
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 3 of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this program; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ */
+import * as React from 'react';
+import { FormattedMessage } from 'react-intl';
+import { ClipboardIconButton } from 'sonar-ui-common/components/controls/clipboard';
+import { translate } from 'sonar-ui-common/helpers/l10n';
+import CodeSnippet from '../../../common/CodeSnippet';
+import { buildGradleSnippet } from '../../utils';
+import CreateYmlFile from './CreateYmlFile';
+
+export interface GradleProps {
+ branchesEnabled?: boolean;
+ component: T.Component;
+}
+const gradleYamlTemplate = (branchesEnabled: boolean) => `name: Build
+on:
+ push:
+ branches:
+ - master # or the name of your main branch
+${branchesEnabled ? ' pull_request:\n types: [opened, synchronize, reopened]' : ''}
+jobs:
+ build:
+ name: Build
+ runs-on: ubuntu-latest
+ steps:
+ - uses: actions/checkout@v2
+ with:
+ fetch-depth: 0 # Shallow clones should be disabled for a better relevancy of analysis
+ - name: Set up JDK 11
+ uses: actions/setup-java@v1
+ with:
+ java-version: 11
+ - name: Cache SonarQube packages
+ uses: actions/cache@v1
+ with:
+ path: ~/.sonar/cache
+ key: \${{ runner.os }}-sonar
+ restore-keys: \${{ runner.os }}-sonar
+ - name: Cache Gradle packages
+ uses: actions/cache@v1
+ with:
+ path: ~/.gradle/caches
+ key: \${{ runner.os }}-gradle-\${{ hashFiles('**/*.gradle') }}
+ restore-keys: \${{ runner.os }}-gradle
+ - name: Build and analyze
+ env:
+ GITHUB_TOKEN: \${{ secrets.GITHUB_TOKEN }} # Needed to get PR information, if any
+ SONAR_TOKEN: \${{ secrets.SONAR_TOKEN }}
+ SONAR_HOST_URL: \${{ secrets.SONAR_HOST_URL }}
+ run: ./gradlew build sonarqube --info`;
+
+export default function Gradle(props: GradleProps) {
+ const { component, branchesEnabled } = props;
+
+ return (
+ <>
+ <li className="abs-width-600">
+ <FormattedMessage
+ defaultMessage={translate('onboarding.tutorial.with.github_action.yaml.gradle')}
+ id="onboarding.tutorial.with.github_action.yaml.gradle"
+ values={{
+ gradle: (
+ <>
+ <code className="rule">build.gradle</code>
+ <ClipboardIconButton copyValue="build.gradle" />
+ </>
+ ),
+ sq: <code className="rule">org.sonarqube</code>
+ }}
+ />
+ <CodeSnippet snippet={buildGradleSnippet(component.key)} />
+ </li>
+ <CreateYmlFile yamlTemplate={gradleYamlTemplate(!!branchesEnabled)} />
+ </>
+ );
+}
--- /dev/null
+/*
+ * SonarQube
+ * Copyright (C) 2009-2021 SonarSource SA
+ * mailto:info AT sonarsource DOT com
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 3 of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this program; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ */
+import * as React from 'react';
+import { FormattedMessage } from 'react-intl';
+import { ClipboardIconButton } from 'sonar-ui-common/components/controls/clipboard';
+import { translate } from 'sonar-ui-common/helpers/l10n';
+import CodeSnippet from '../../../common/CodeSnippet';
+import { mavenPomSnippet } from '../../utils';
+import CreateYmlFile from './CreateYmlFile';
+
+export interface JavaMavenProps {
+ branchesEnabled?: boolean;
+ component: T.Component;
+}
+
+const mavenYamlTemplte = (branchesEnabled: boolean) => `name: Build
+on:
+ push:
+ branches:
+ - master # or the name of your main branch
+${branchesEnabled ? ' pull_request:\n types: [opened, synchronize, reopened]' : ''}
+jobs:
+ build:
+ name: Build
+ runs-on: ubuntu-latest
+ steps:
+ - uses: actions/checkout@v2
+ with:
+ fetch-depth: 0 # Shallow clones should be disabled for a better relevancy of analysis
+ - name: Set up JDK 11
+ uses: actions/setup-java@v1
+ with:
+ java-version: 11
+ - name: Cache SonarQube packages
+ uses: actions/cache@v1
+ with:
+ path: ~/.sonar/cache
+ key: \${{ runner.os }}-sonar
+ restore-keys: \${{ runner.os }}-sonar
+ - name: Cache Maven packages
+ uses: actions/cache@v1
+ with:
+ path: ~/.m2
+ key: \${{ runner.os }}-m2-\${{ hashFiles('**/pom.xml') }}
+ restore-keys: \${{ runner.os }}-m2
+ - name: Build and analyze
+ env:
+ GITHUB_TOKEN: \${{ secrets.GITHUB_TOKEN }} # Needed to get PR information, if any
+ SONAR_TOKEN: \${{ secrets.SONAR_TOKEN }}
+ SONAR_HOST_URL: \${{ secrets.SONAR_HOST_URL }}
+ run: mvn -B verify org.sonarsource.scanner.maven:sonar-maven-plugin:sonar`;
+
+export default function JavaMaven(props: JavaMavenProps) {
+ const { component, branchesEnabled } = props;
+ return (
+ <>
+ <li className="abs-width-600">
+ <FormattedMessage
+ defaultMessage={translate('onboarding.tutorial.with.github_action.yaml.maven.pom')}
+ id="onboarding.tutorial.with.github_action.yaml.maven.pom"
+ values={{
+ pom: (
+ <>
+ <code className="rule">pom.xml</code>
+ <ClipboardIconButton copyValue="pom.xml" />
+ </>
+ )
+ }}
+ />
+ <CodeSnippet snippet={mavenPomSnippet(component.key)} />
+ </li>
+ <CreateYmlFile yamlTemplate={mavenYamlTemplte(!!branchesEnabled)} />
+ </>
+ );
+}
--- /dev/null
+/*
+ * SonarQube
+ * Copyright (C) 2009-2021 SonarSource SA
+ * mailto:info AT sonarsource DOT com
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 3 of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this program; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ */
+import * as React from 'react';
+import DefaultProjectKey from '../../components/DefaultProjectKey';
+import CreateYmlFile from './CreateYmlFile';
+
+export interface OthersProps {
+ branchesEnabled?: boolean;
+ component: T.Component;
+}
+
+const dotnetYamlTemplate = (branchesEnabled: boolean) => `name: Build
+on:
+ push:
+ branches:
+ - master # or the name of your main branch
+${branchesEnabled ? ' pull_request:\n types: [opened, synchronize, reopened]' : ''}
+jobs:
+ build:
+ name: Build
+ runs-on: ubuntu-latest
+ steps:
+ - uses: actions/checkout@v2
+ with:
+ fetch-depth: 0
+ - uses: docker://sonarsource/sonar-scanner-cli:latest
+ env:
+ GITHUB_TOKEN: \${{ secrets.GITHUB_TOKEN }}
+ SONAR_TOKEN: \${{ secrets.SONAR_TOKEN }}
+ SONAR_HOST_URL: \${{ secrets.SONAR_HOST_URL }}`;
+
+export default function Others(props: OthersProps) {
+ const { component, branchesEnabled } = props;
+ return (
+ <>
+ <DefaultProjectKey component={component} />
+ <CreateYmlFile yamlTemplate={dotnetYamlTemplate(!!branchesEnabled)} />
+ </>
+ );
+}
--- /dev/null
+/*
+ * SonarQube
+ * Copyright (C) 2009-2021 SonarSource SA
+ * mailto:info AT sonarsource DOT com
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 3 of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this program; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ */
+import { shallow } from 'enzyme';
+import * as React from 'react';
+import CreateYmlFile, { CreateYmlFileProps } from '../CreateYmlFile';
+import { GradleProps } from '../Gradle';
+
+it('should render correctly', () => {
+ expect(shallowRender()).toMatchSnapshot();
+});
+
+function shallowRender(props: Partial<CreateYmlFileProps> = {}) {
+ return shallow<GradleProps>(<CreateYmlFile yamlTemplate="temaplate" {...props} />);
+}
--- /dev/null
+/*
+ * SonarQube
+ * Copyright (C) 2009-2021 SonarSource SA
+ * mailto:info AT sonarsource DOT com
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 3 of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this program; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ */
+import { shallow } from 'enzyme';
+import * as React from 'react';
+import { mockComponent } from '../../../../../helpers/testMocks';
+import DotNet, { DotNetProps } from '../DotNet';
+
+it('should render correctly', () => {
+ expect(shallowRender()).toMatchSnapshot();
+ expect(shallowRender({ branchesEnabled: false })).toMatchSnapshot('without branch enabled');
+});
+
+function shallowRender(props: Partial<DotNetProps> = {}) {
+ return shallow<DotNetProps>(
+ <DotNet branchesEnabled={true} component={mockComponent()} {...props} />
+ );
+}
--- /dev/null
+/*
+ * SonarQube
+ * Copyright (C) 2009-2021 SonarSource SA
+ * mailto:info AT sonarsource DOT com
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 3 of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this program; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ */
+import { shallow } from 'enzyme';
+import * as React from 'react';
+import { mockComponent } from '../../../../../helpers/testMocks';
+import Gradle, { GradleProps } from '../Gradle';
+
+it('should render correctly', () => {
+ expect(shallowRender()).toMatchSnapshot();
+ expect(shallowRender({ branchesEnabled: false })).toMatchSnapshot('without branch enabled');
+});
+
+function shallowRender(props: Partial<GradleProps> = {}) {
+ return shallow<GradleProps>(
+ <Gradle branchesEnabled={true} component={mockComponent()} {...props} />
+ );
+}
--- /dev/null
+/*
+ * SonarQube
+ * Copyright (C) 2009-2021 SonarSource SA
+ * mailto:info AT sonarsource DOT com
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 3 of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this program; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ */
+import { shallow } from 'enzyme';
+import * as React from 'react';
+import { mockComponent } from '../../../../../helpers/testMocks';
+import JavaMaven, { JavaMavenProps } from '../../commands/JavaMaven';
+
+it('should render correctly', () => {
+ expect(shallowRender()).toMatchSnapshot();
+ expect(shallowRender({ branchesEnabled: false })).toMatchSnapshot('without branch enabled');
+});
+
+function shallowRender(props: Partial<JavaMavenProps> = {}) {
+ return shallow<JavaMavenProps>(
+ <JavaMaven branchesEnabled={true} component={mockComponent()} {...props} />
+ );
+}
--- /dev/null
+/*
+ * SonarQube
+ * Copyright (C) 2009-2021 SonarSource SA
+ * mailto:info AT sonarsource DOT com
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 3 of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this program; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ */
+import { shallow } from 'enzyme';
+import * as React from 'react';
+import { mockComponent } from '../../../../../helpers/testMocks';
+import Others, { OthersProps } from '../../commands/Others';
+
+it('should render correctly', () => {
+ expect(shallowRender()).toMatchSnapshot();
+ expect(shallowRender({ branchesEnabled: false })).toMatchSnapshot('without branch enabled');
+});
+
+function shallowRender(props: Partial<OthersProps> = {}) {
+ return shallow<OthersProps>(
+ <Others branchesEnabled={true} component={mockComponent()} {...props} />
+ );
+}
--- /dev/null
+// Jest Snapshot v1, https://goo.gl/fbAQLP
+
+exports[`should render correctly 1`] = `
+<li
+ className="abs-width-800"
+>
+ <FormattedMessage
+ defaultMessage="onboarding.tutorial.with.github_action.yaml.create_yml"
+ id="onboarding.tutorial.with.github_action.yaml.create_yml"
+ values={
+ Object {
+ "file": <React.Fragment>
+ <code
+ className="rule"
+ >
+ .github/workflows/build.yml
+ </code>
+ <ClipboardIconButton
+ copyValue=".github/workflows/build.yml"
+ />
+ </React.Fragment>,
+ }
+ }
+ />
+ <CodeSnippet
+ snippet="temaplate"
+ />
+</li>
+`;
--- /dev/null
+// Jest Snapshot v1, https://goo.gl/fbAQLP
+
+exports[`should render correctly 1`] = `
+<CreateYmlFile
+ yamlTemplate="name: Build
+on:
+ push:
+ branches:
+ - master # or the name of your main branch
+ pull_request:
+ types: [opened, synchronize, reopened]
+jobs:
+ build:
+ name: Build
+ runs-on: windows-latest
+ steps:
+ - name: Set up JDK 11
+ uses: actions/setup-java@v1
+ with:
+ java-version: 1.11
+ - uses: actions/checkout@v2
+ with:
+ fetch-depth: 0 # Shallow clones should be disabled for a better relevancy of analysis
+ - name: Cache SonarQube packages
+ uses: actions/cache@v1
+ with:
+ path: ~\\\\sonar\\\\cache
+ key: \${{ runner.os }}-sonar
+ restore-keys: \${{ runner.os }}-sonar
+ - name: Cache SonarQube scanner
+ id: cache-sonar-scanner
+ uses: actions/cache@v1
+ with:
+ path: .\\\\.sonar\\\\scanner
+ key: \${{ runner.os }}-sonar-scanner
+ restore-keys: \${{ runner.os }}-sonar-scanner
+ - name: Install SonarQube scanner
+ if: steps.cache-sonar-scanner.outputs.cache-hit != 'true'
+ shell: powershell
+ run: |
+ New-Item -Path .\\\\.sonar\\\\scanner -ItemType Directory
+ dotnet tool update dotnet-sonarscanner --tool-path .\\\\.sonar\\\\scanner
+ - name: Build and analyze
+ env:
+ GITHUB_TOKEN: \${{ secrets.GITHUB_TOKEN }} # Needed to get PR information, if any
+ shell: powershell
+ run: |
+ .\\\\.sonar\\\\scanner\\\\dotnet-sonarscanner begin /k:\\"my-project\\" /d:sonar.login=\\"\${{ secrets.SONAR_TOKEN }}\\" /d:sonar.host.url=\\"\${{ secrets.SONAR_HOST_URL }}\\"
+ dotnet build
+ .\\\\.sonar\\\\scanner\\\\dotnet-sonarscanner end /d:sonar.login=\\"\${{ secrets.SONAR_TOKEN }}\\""
+/>
+`;
+
+exports[`should render correctly: without branch enabled 1`] = `
+<CreateYmlFile
+ yamlTemplate="name: Build
+on:
+ push:
+ branches:
+ - master # or the name of your main branch
+
+jobs:
+ build:
+ name: Build
+ runs-on: windows-latest
+ steps:
+ - name: Set up JDK 11
+ uses: actions/setup-java@v1
+ with:
+ java-version: 1.11
+ - uses: actions/checkout@v2
+ with:
+ fetch-depth: 0 # Shallow clones should be disabled for a better relevancy of analysis
+ - name: Cache SonarQube packages
+ uses: actions/cache@v1
+ with:
+ path: ~\\\\sonar\\\\cache
+ key: \${{ runner.os }}-sonar
+ restore-keys: \${{ runner.os }}-sonar
+ - name: Cache SonarQube scanner
+ id: cache-sonar-scanner
+ uses: actions/cache@v1
+ with:
+ path: .\\\\.sonar\\\\scanner
+ key: \${{ runner.os }}-sonar-scanner
+ restore-keys: \${{ runner.os }}-sonar-scanner
+ - name: Install SonarQube scanner
+ if: steps.cache-sonar-scanner.outputs.cache-hit != 'true'
+ shell: powershell
+ run: |
+ New-Item -Path .\\\\.sonar\\\\scanner -ItemType Directory
+ dotnet tool update dotnet-sonarscanner --tool-path .\\\\.sonar\\\\scanner
+ - name: Build and analyze
+ env:
+ GITHUB_TOKEN: \${{ secrets.GITHUB_TOKEN }} # Needed to get PR information, if any
+ shell: powershell
+ run: |
+ .\\\\.sonar\\\\scanner\\\\dotnet-sonarscanner begin /k:\\"my-project\\" /d:sonar.login=\\"\${{ secrets.SONAR_TOKEN }}\\" /d:sonar.host.url=\\"\${{ secrets.SONAR_HOST_URL }}\\"
+ dotnet build
+ .\\\\.sonar\\\\scanner\\\\dotnet-sonarscanner end /d:sonar.login=\\"\${{ secrets.SONAR_TOKEN }}\\""
+/>
+`;
--- /dev/null
+// Jest Snapshot v1, https://goo.gl/fbAQLP
+
+exports[`should render correctly 1`] = `
+<Fragment>
+ <li
+ className="abs-width-600"
+ >
+ <FormattedMessage
+ defaultMessage="onboarding.tutorial.with.github_action.yaml.gradle"
+ id="onboarding.tutorial.with.github_action.yaml.gradle"
+ values={
+ Object {
+ "gradle": <React.Fragment>
+ <code
+ className="rule"
+ >
+ build.gradle
+ </code>
+ <ClipboardIconButton
+ copyValue="build.gradle"
+ />
+ </React.Fragment>,
+ "sq": <code
+ className="rule"
+ >
+ org.sonarqube
+ </code>,
+ }
+ }
+ />
+ <CodeSnippet
+ snippet="plugins {
+ id \\"org.sonarqube\\" version \\"3.1.1\\"
+}
+
+sonarqube {
+ properties {
+ property \\"sonar.projectKey\\", \\"my-project\\"
+ }
+}"
+ />
+ </li>
+ <CreateYmlFile
+ yamlTemplate="name: Build
+on:
+ push:
+ branches:
+ - master # or the name of your main branch
+ pull_request:
+ types: [opened, synchronize, reopened]
+jobs:
+ build:
+ name: Build
+ runs-on: ubuntu-latest
+ steps:
+ - uses: actions/checkout@v2
+ with:
+ fetch-depth: 0 # Shallow clones should be disabled for a better relevancy of analysis
+ - name: Set up JDK 11
+ uses: actions/setup-java@v1
+ with:
+ java-version: 11
+ - name: Cache SonarQube packages
+ uses: actions/cache@v1
+ with:
+ path: ~/.sonar/cache
+ key: \${{ runner.os }}-sonar
+ restore-keys: \${{ runner.os }}-sonar
+ - name: Cache Gradle packages
+ uses: actions/cache@v1
+ with:
+ path: ~/.gradle/caches
+ key: \${{ runner.os }}-gradle-\${{ hashFiles('**/*.gradle') }}
+ restore-keys: \${{ runner.os }}-gradle
+ - name: Build and analyze
+ env:
+ GITHUB_TOKEN: \${{ secrets.GITHUB_TOKEN }} # Needed to get PR information, if any
+ SONAR_TOKEN: \${{ secrets.SONAR_TOKEN }}
+ SONAR_HOST_URL: \${{ secrets.SONAR_HOST_URL }}
+ run: ./gradlew build sonarqube --info"
+ />
+</Fragment>
+`;
+
+exports[`should render correctly: without branch enabled 1`] = `
+<Fragment>
+ <li
+ className="abs-width-600"
+ >
+ <FormattedMessage
+ defaultMessage="onboarding.tutorial.with.github_action.yaml.gradle"
+ id="onboarding.tutorial.with.github_action.yaml.gradle"
+ values={
+ Object {
+ "gradle": <React.Fragment>
+ <code
+ className="rule"
+ >
+ build.gradle
+ </code>
+ <ClipboardIconButton
+ copyValue="build.gradle"
+ />
+ </React.Fragment>,
+ "sq": <code
+ className="rule"
+ >
+ org.sonarqube
+ </code>,
+ }
+ }
+ />
+ <CodeSnippet
+ snippet="plugins {
+ id \\"org.sonarqube\\" version \\"3.1.1\\"
+}
+
+sonarqube {
+ properties {
+ property \\"sonar.projectKey\\", \\"my-project\\"
+ }
+}"
+ />
+ </li>
+ <CreateYmlFile
+ yamlTemplate="name: Build
+on:
+ push:
+ branches:
+ - master # or the name of your main branch
+
+jobs:
+ build:
+ name: Build
+ runs-on: ubuntu-latest
+ steps:
+ - uses: actions/checkout@v2
+ with:
+ fetch-depth: 0 # Shallow clones should be disabled for a better relevancy of analysis
+ - name: Set up JDK 11
+ uses: actions/setup-java@v1
+ with:
+ java-version: 11
+ - name: Cache SonarQube packages
+ uses: actions/cache@v1
+ with:
+ path: ~/.sonar/cache
+ key: \${{ runner.os }}-sonar
+ restore-keys: \${{ runner.os }}-sonar
+ - name: Cache Gradle packages
+ uses: actions/cache@v1
+ with:
+ path: ~/.gradle/caches
+ key: \${{ runner.os }}-gradle-\${{ hashFiles('**/*.gradle') }}
+ restore-keys: \${{ runner.os }}-gradle
+ - name: Build and analyze
+ env:
+ GITHUB_TOKEN: \${{ secrets.GITHUB_TOKEN }} # Needed to get PR information, if any
+ SONAR_TOKEN: \${{ secrets.SONAR_TOKEN }}
+ SONAR_HOST_URL: \${{ secrets.SONAR_HOST_URL }}
+ run: ./gradlew build sonarqube --info"
+ />
+</Fragment>
+`;
--- /dev/null
+// Jest Snapshot v1, https://goo.gl/fbAQLP
+
+exports[`should render correctly 1`] = `
+<Fragment>
+ <li
+ className="abs-width-600"
+ >
+ <FormattedMessage
+ defaultMessage="onboarding.tutorial.with.github_action.yaml.maven.pom"
+ id="onboarding.tutorial.with.github_action.yaml.maven.pom"
+ values={
+ Object {
+ "pom": <React.Fragment>
+ <code
+ className="rule"
+ >
+ pom.xml
+ </code>
+ <ClipboardIconButton
+ copyValue="pom.xml"
+ />
+ </React.Fragment>,
+ }
+ }
+ />
+ <CodeSnippet
+ snippet="<properties>
+ <sonar.projectKey>my-project</sonar.projectKey>
+</properties>"
+ />
+ </li>
+ <CreateYmlFile
+ yamlTemplate="name: Build
+on:
+ push:
+ branches:
+ - master # or the name of your main branch
+ pull_request:
+ types: [opened, synchronize, reopened]
+jobs:
+ build:
+ name: Build
+ runs-on: ubuntu-latest
+ steps:
+ - uses: actions/checkout@v2
+ with:
+ fetch-depth: 0 # Shallow clones should be disabled for a better relevancy of analysis
+ - name: Set up JDK 11
+ uses: actions/setup-java@v1
+ with:
+ java-version: 11
+ - name: Cache SonarQube packages
+ uses: actions/cache@v1
+ with:
+ path: ~/.sonar/cache
+ key: \${{ runner.os }}-sonar
+ restore-keys: \${{ runner.os }}-sonar
+ - name: Cache Maven packages
+ uses: actions/cache@v1
+ with:
+ path: ~/.m2
+ key: \${{ runner.os }}-m2-\${{ hashFiles('**/pom.xml') }}
+ restore-keys: \${{ runner.os }}-m2
+ - name: Build and analyze
+ env:
+ GITHUB_TOKEN: \${{ secrets.GITHUB_TOKEN }} # Needed to get PR information, if any
+ SONAR_TOKEN: \${{ secrets.SONAR_TOKEN }}
+ SONAR_HOST_URL: \${{ secrets.SONAR_HOST_URL }}
+ run: mvn -B verify org.sonarsource.scanner.maven:sonar-maven-plugin:sonar"
+ />
+</Fragment>
+`;
+
+exports[`should render correctly: without branch enabled 1`] = `
+<Fragment>
+ <li
+ className="abs-width-600"
+ >
+ <FormattedMessage
+ defaultMessage="onboarding.tutorial.with.github_action.yaml.maven.pom"
+ id="onboarding.tutorial.with.github_action.yaml.maven.pom"
+ values={
+ Object {
+ "pom": <React.Fragment>
+ <code
+ className="rule"
+ >
+ pom.xml
+ </code>
+ <ClipboardIconButton
+ copyValue="pom.xml"
+ />
+ </React.Fragment>,
+ }
+ }
+ />
+ <CodeSnippet
+ snippet="<properties>
+ <sonar.projectKey>my-project</sonar.projectKey>
+</properties>"
+ />
+ </li>
+ <CreateYmlFile
+ yamlTemplate="name: Build
+on:
+ push:
+ branches:
+ - master # or the name of your main branch
+
+jobs:
+ build:
+ name: Build
+ runs-on: ubuntu-latest
+ steps:
+ - uses: actions/checkout@v2
+ with:
+ fetch-depth: 0 # Shallow clones should be disabled for a better relevancy of analysis
+ - name: Set up JDK 11
+ uses: actions/setup-java@v1
+ with:
+ java-version: 11
+ - name: Cache SonarQube packages
+ uses: actions/cache@v1
+ with:
+ path: ~/.sonar/cache
+ key: \${{ runner.os }}-sonar
+ restore-keys: \${{ runner.os }}-sonar
+ - name: Cache Maven packages
+ uses: actions/cache@v1
+ with:
+ path: ~/.m2
+ key: \${{ runner.os }}-m2-\${{ hashFiles('**/pom.xml') }}
+ restore-keys: \${{ runner.os }}-m2
+ - name: Build and analyze
+ env:
+ GITHUB_TOKEN: \${{ secrets.GITHUB_TOKEN }} # Needed to get PR information, if any
+ SONAR_TOKEN: \${{ secrets.SONAR_TOKEN }}
+ SONAR_HOST_URL: \${{ secrets.SONAR_HOST_URL }}
+ run: mvn -B verify org.sonarsource.scanner.maven:sonar-maven-plugin:sonar"
+ />
+</Fragment>
+`;
--- /dev/null
+// Jest Snapshot v1, https://goo.gl/fbAQLP
+
+exports[`should render correctly 1`] = `
+<Fragment>
+ <DefaultProjectKey
+ component={
+ Object {
+ "breadcrumbs": Array [],
+ "key": "my-project",
+ "name": "MyProject",
+ "qualifier": "TRK",
+ "qualityGate": Object {
+ "isDefault": true,
+ "key": "30",
+ "name": "Sonar way",
+ },
+ "qualityProfiles": Array [
+ Object {
+ "deleted": false,
+ "key": "my-qp",
+ "language": "ts",
+ "name": "Sonar way",
+ },
+ ],
+ "tags": Array [],
+ }
+ }
+ />
+ <CreateYmlFile
+ yamlTemplate="name: Build
+on:
+ push:
+ branches:
+ - master # or the name of your main branch
+ pull_request:
+ types: [opened, synchronize, reopened]
+jobs:
+ build:
+ name: Build
+ runs-on: ubuntu-latest
+ steps:
+ - uses: actions/checkout@v2
+ with:
+ fetch-depth: 0
+ - uses: docker://sonarsource/sonar-scanner-cli:latest
+ env:
+ GITHUB_TOKEN: \${{ secrets.GITHUB_TOKEN }}
+ SONAR_TOKEN: \${{ secrets.SONAR_TOKEN }}
+ SONAR_HOST_URL: \${{ secrets.SONAR_HOST_URL }}"
+ />
+</Fragment>
+`;
+
+exports[`should render correctly: without branch enabled 1`] = `
+<Fragment>
+ <DefaultProjectKey
+ component={
+ Object {
+ "breadcrumbs": Array [],
+ "key": "my-project",
+ "name": "MyProject",
+ "qualifier": "TRK",
+ "qualityGate": Object {
+ "isDefault": true,
+ "key": "30",
+ "name": "Sonar way",
+ },
+ "qualityProfiles": Array [
+ Object {
+ "deleted": false,
+ "key": "my-qp",
+ "language": "ts",
+ "name": "Sonar way",
+ },
+ ],
+ "tags": Array [],
+ }
+ }
+ />
+ <CreateYmlFile
+ yamlTemplate="name: Build
+on:
+ push:
+ branches:
+ - master # or the name of your main branch
+
+jobs:
+ build:
+ name: Build
+ runs-on: ubuntu-latest
+ steps:
+ - uses: actions/checkout@v2
+ with:
+ fetch-depth: 0
+ - uses: docker://sonarsource/sonar-scanner-cli:latest
+ env:
+ GITHUB_TOKEN: \${{ secrets.GITHUB_TOKEN }}
+ SONAR_TOKEN: \${{ secrets.SONAR_TOKEN }}
+ SONAR_HOST_URL: \${{ secrets.SONAR_HOST_URL }}"
+ />
+</Fragment>
+`;
import { Button } from 'sonar-ui-common/components/controls/buttons';
import { ClipboardIconButton } from 'sonar-ui-common/components/controls/clipboard';
import { translate } from 'sonar-ui-common/helpers/l10n';
-import EditTokenModal from '../components/EditTokenModal';
import Step from '../components/Step';
+import TokenStepGenerator from '../components/TokenStepGenerator';
export interface EnvironmentVariablesStepProps {
baseUrl: string;
export default function EnvironmentVariablesStep(props: EnvironmentVariablesStepProps) {
const { baseUrl, component, currentUser, finished, open } = props;
- const [isModalVisible, toggleModal] = React.useState(false);
-
- const toggleTokenModal = () => toggleModal(!isModalVisible);
- const closeTokenModal = () => toggleModal(false);
-
- const fieldValueTranslation = translate(
- 'onboarding.tutorial.with.gitlab_ci.env_variables.enter_field_value'
- );
+ const fieldValueTranslation = translate('onboarding.tutorial.env_variables');
const renderForm = () => (
<div className="boxed-group-inner">
id="onboarding.tutorial.with.gitlab_ci.env_variables.step1"
values={{
extra: <ClipboardIconButton copyValue="SONAR_TOKEN" />,
- field: translate('onboarding.tutorial.with.gitlab_ci.env_variables.step1'),
- value: <code className="rule">SONAR_TOKEN</code>
- }}
- />
- </li>
- <li className="big-spacer-bottom">
- <FormattedMessage
- defaultMessage={fieldValueTranslation}
- id="onboarding.tutorial.with.gitlab_ci.env_variables.step2"
- values={{
- extra: (
- <Button className="spacer-left" onClick={toggleTokenModal}>
- {translate('onboarding.token.generate_token')}
- </Button>
+ field: (
+ <strong>
+ {translate('onboarding.tutorial.with.gitlab_ci.env_variables.step1')}
+ </strong>
),
- field: translate('onboarding.tutorial.with.gitlab_ci.env_variables.step2'),
- value: translate(
- 'onboarding.tutorial.with.gitlab_ci.env_variables.section.step2.value'
- )
+ value: <code className="rule">SONAR_TOKEN</code>
}}
/>
</li>
+ <TokenStepGenerator component={component} currentUser={currentUser} />
<li className="big-spacer-bottom">
{translate('onboarding.tutorial.with.gitlab_ci.env_variables.step3')}
</li>
id="onboarding.tutorial.with.gitlab_ci.env_variables.step1"
values={{
extra: <ClipboardIconButton copyValue="SONAR_HOST_URL" />,
- field: translate('onboarding.tutorial.with.gitlab_ci.env_variables.step1'),
+ field: (
+ <strong>
+ {translate('onboarding.tutorial.with.gitlab_ci.env_variables.step1')}
+ </strong>
+ ),
value: <code className="rule">SONAR_HOST_URL</code>
}}
/>
id="onboarding.tutorial.with.gitlab_ci.env_variables.step2"
values={{
extra: <ClipboardIconButton copyValue={baseUrl} />,
- field: translate('onboarding.tutorial.with.gitlab_ci.env_variables.step2'),
+ field: <strong>{translate('onboarding.tutorial.env_variables.field')}</strong>,
value: <code className="rule">{baseUrl}</code>
}}
/>
);
return (
- <>
- {isModalVisible && (
- <EditTokenModal component={component} currentUser={currentUser} onClose={closeTokenModal} />
- )}
-
- <Step
- finished={finished}
- onOpen={props.onOpen}
- open={open}
- renderForm={renderForm}
- stepNumber={2}
- stepTitle={translate('onboarding.tutorial.with.gitlab_ci.env_variables.title')}
- />
- </>
+ <Step
+ finished={finished}
+ onOpen={props.onOpen}
+ open={open}
+ renderForm={renderForm}
+ stepNumber={2}
+ stepTitle={translate('onboarding.tutorial.with.gitlab_ci.env_variables.title')}
+ />
);
}
// Jest Snapshot v1, https://goo.gl/fbAQLP
exports[`should render correctly: Step wrapper 1`] = `
-<Fragment>
- <Step
- finished={false}
- onOpen={[MockFunction]}
- open={true}
- renderForm={[Function]}
- stepNumber={2}
- stepTitle="onboarding.tutorial.with.gitlab_ci.env_variables.title"
- />
-</Fragment>
+<Step
+ finished={false}
+ onOpen={[MockFunction]}
+ open={true}
+ renderForm={[Function]}
+ stepNumber={2}
+ stepTitle="onboarding.tutorial.with.gitlab_ci.env_variables.title"
+/>
`;
exports[`should render correctly: initial content 1`] = `
className="big-spacer-bottom"
>
<FormattedMessage
- defaultMessage="onboarding.tutorial.with.gitlab_ci.env_variables.enter_field_value"
+ defaultMessage="onboarding.tutorial.env_variables"
id="onboarding.tutorial.with.gitlab_ci.env_variables.step1"
values={
Object {
"extra": <ClipboardIconButton
copyValue="SONAR_TOKEN"
/>,
- "field": "onboarding.tutorial.with.gitlab_ci.env_variables.step1",
+ "field": <strong>
+ onboarding.tutorial.with.gitlab_ci.env_variables.step1
+ </strong>,
"value": <code
className="rule"
>
}
/>
</li>
- <li
- className="big-spacer-bottom"
- >
- <FormattedMessage
- defaultMessage="onboarding.tutorial.with.gitlab_ci.env_variables.enter_field_value"
- id="onboarding.tutorial.with.gitlab_ci.env_variables.step2"
- values={
- Object {
- "extra": <Button
- className="spacer-left"
- onClick={[Function]}
- >
- onboarding.token.generate_token
- </Button>,
- "field": "onboarding.tutorial.with.gitlab_ci.env_variables.step2",
- "value": "onboarding.tutorial.with.gitlab_ci.env_variables.section.step2.value",
- }
+ <TokenStepGenerator
+ component={
+ Object {
+ "breadcrumbs": Array [],
+ "key": "my-project",
+ "name": "MyProject",
+ "qualifier": "TRK",
+ "qualityGate": Object {
+ "isDefault": true,
+ "key": "30",
+ "name": "Sonar way",
+ },
+ "qualityProfiles": Array [
+ Object {
+ "deleted": false,
+ "key": "my-qp",
+ "language": "ts",
+ "name": "Sonar way",
+ },
+ ],
+ "tags": Array [],
}
- />
- </li>
+ }
+ currentUser={
+ Object {
+ "groups": Array [],
+ "isLoggedIn": true,
+ "login": "luke",
+ "name": "Skywalker",
+ "scmAccounts": Array [],
+ }
+ }
+ />
<li
className="big-spacer-bottom"
>
className="big-spacer-bottom"
>
<FormattedMessage
- defaultMessage="onboarding.tutorial.with.gitlab_ci.env_variables.enter_field_value"
+ defaultMessage="onboarding.tutorial.env_variables"
id="onboarding.tutorial.with.gitlab_ci.env_variables.step1"
values={
Object {
"extra": <ClipboardIconButton
copyValue="SONAR_HOST_URL"
/>,
- "field": "onboarding.tutorial.with.gitlab_ci.env_variables.step1",
+ "field": <strong>
+ onboarding.tutorial.with.gitlab_ci.env_variables.step1
+ </strong>,
"value": <code
className="rule"
>
className="big-spacer-bottom"
>
<FormattedMessage
- defaultMessage="onboarding.tutorial.with.gitlab_ci.env_variables.enter_field_value"
+ defaultMessage="onboarding.tutorial.env_variables"
id="onboarding.tutorial.with.gitlab_ci.env_variables.step2"
values={
Object {
"extra": <ClipboardIconButton
copyValue="http://localhost:9000"
/>,
- "field": "onboarding.tutorial.with.gitlab_ci.env_variables.step2",
+ "field": <strong>
+ onboarding.tutorial.env_variables.field
+ </strong>,
"value": <code
className="rule"
>
*/
import * as React from 'react';
import { translate } from 'sonar-ui-common/helpers/l10n';
-import { getBaseUrl } from 'sonar-ui-common/helpers/urls';
-import { withAppState } from '../../hoc/withAppState';
+import AllSet from '../components/AllSet';
import RenderOptions from '../components/RenderOptions';
-import SentenceWithHighlights from '../components/SentenceWithHighlights';
import Step from '../components/Step';
import { BuildTools } from '../types';
import DotNet from './buildtool-steps/DotNet';
import Other from './buildtool-steps/Other';
export interface JenkinsfileStepProps {
- appState: T.AppState;
component: T.Component;
open: boolean;
}
[BuildTools.Other]: Other
};
-export function JenkinsfileStep(props: JenkinsfileStepProps) {
- const {
- appState: { branchesEnabled },
- component,
- open
- } = props;
+export default function JenkinsfileStep(props: JenkinsfileStepProps) {
+ const { component, open } = props;
const [buildTool, setBuildTool] = React.useState<BuildToolsWithoutCFamily | undefined>(undefined);
return (
<Step
{buildTool !== undefined && (
<>
<hr className="huge-spacer-top huge-spacer-bottom" />
- <div className="abs-width-600">
- <p className="big-spacer-bottom">
- <SentenceWithHighlights
- highlightKeys={['all_set']}
- translationKey="onboarding.tutorial.with.jenkins.all_set"
- />
- </p>
- <div className="display-flex-row big-spacer-bottom">
- <div>
- <img
- alt="" // Should be ignored by screen readers
- className="big-spacer-right"
- width={30}
- src={`${getBaseUrl()}/images/tutorials/commit.svg`}
- />
- </div>
- <div>
- <p className="little-spacer-bottom">
- <strong>{translate('onboarding.tutorial.with.jenkins.commit')}</strong>
- </p>
- <p>
- {branchesEnabled
- ? translate('onboarding.tutorial.with.jenkins.commit.why')
- : translate('onboarding.tutorial.with.jenkins.commit.why.no_branches')}
- </p>
- </div>
- </div>
- <div className="display-flex-row huge-spacer-bottom">
- <div>
- <img
- alt="" // Should be ignored by screen readers
- className="big-spacer-right"
- width={30}
- src={`${getBaseUrl()}/images/tutorials/refresh.svg`}
- />
- </div>
- <div>
- <p className="little-spacer-bottom">
- <strong>{translate('onboarding.tutorial.with.jenkins.refresh')}</strong>
- </p>
- <p>{translate('onboarding.tutorial.with.jenkins.refresh.why')}</p>
- </div>
- </div>
- </div>
+ <AllSet />
</>
)}
</div>
/>
);
}
-
-export default withAppState(JenkinsfileStep);
*/
import { shallow, ShallowWrapper } from 'enzyme';
import * as React from 'react';
-import { mockAppState, mockComponent } from '../../../../helpers/testMocks';
+import { mockComponent } from '../../../../helpers/testMocks';
import RenderOptions from '../../components/RenderOptions';
import Step from '../../components/Step';
import { BuildTools } from '../../types';
-import { JenkinsfileStep, JenkinsfileStepProps } from '../JenkinsfileStep';
+import JenkinsfileStep, { JenkinsfileStepProps } from '../JenkinsfileStep';
import { renderStepContent } from '../test-utils';
it('should render correctly', () => {
expect(renderStepContent(wrapper)).toMatchSnapshot('initial content');
});
-it('should render correctly with no branches', () => {
- const wrapper = shallowRender({ appState: mockAppState({ branchesEnabled: false }) });
- selectBuildTool(wrapper, BuildTools.Gradle);
- expect(renderStepContent(wrapper)).toMatchSnapshot();
-});
-
it('should render correctly for Maven', () => {
const wrapper = shallowRender();
selectBuildTool(wrapper, BuildTools.Maven);
function shallowRender(props: Partial<JenkinsfileStepProps> = {}) {
return shallow<JenkinsfileStepProps>(
- <JenkinsfileStep
- appState={mockAppState({ branchesEnabled: true })}
- component={mockComponent()}
- open={true}
- {...props}
- />
+ <JenkinsfileStep component={mockComponent()} open={true} {...props} />
);
}
}
}
/>
- <Connect(withAppState(JenkinsfileStep))
+ <JenkinsfileStep
component={
Object {
"breadcrumbs": Array [],
}
}
/>
- <Connect(withAppState(JenkinsfileStep))
+ <JenkinsfileStep
component={
Object {
"breadcrumbs": Array [],
<hr
className="huge-spacer-top huge-spacer-bottom"
/>
- <div
- className="abs-width-600"
- >
- <p
- className="big-spacer-bottom"
- >
- <SentenceWithHighlights
- highlightKeys={
- Array [
- "all_set",
- ]
- }
- translationKey="onboarding.tutorial.with.jenkins.all_set"
- />
- </p>
- <div
- className="display-flex-row big-spacer-bottom"
- >
- <div>
- <img
- alt=""
- className="big-spacer-right"
- src="/images/tutorials/commit.svg"
- width={30}
- />
- </div>
- <div>
- <p
- className="little-spacer-bottom"
- >
- <strong>
- onboarding.tutorial.with.jenkins.commit
- </strong>
- </p>
- <p>
- onboarding.tutorial.with.jenkins.commit.why
- </p>
- </div>
- </div>
- <div
- className="display-flex-row huge-spacer-bottom"
- >
- <div>
- <img
- alt=""
- className="big-spacer-right"
- src="/images/tutorials/refresh.svg"
- width={30}
- />
- </div>
- <div>
- <p
- className="little-spacer-bottom"
- >
- <strong>
- onboarding.tutorial.with.jenkins.refresh
- </strong>
- </p>
- <p>
- onboarding.tutorial.with.jenkins.refresh.why
- </p>
- </div>
- </div>
- </div>
+ <Connect(withAppState(AllSet)) />
</React.Fragment>
</div>
`;
<hr
className="huge-spacer-top huge-spacer-bottom"
/>
- <div
- className="abs-width-600"
- >
- <p
- className="big-spacer-bottom"
- >
- <SentenceWithHighlights
- highlightKeys={
- Array [
- "all_set",
- ]
- }
- translationKey="onboarding.tutorial.with.jenkins.all_set"
- />
- </p>
- <div
- className="display-flex-row big-spacer-bottom"
- >
- <div>
- <img
- alt=""
- className="big-spacer-right"
- src="/images/tutorials/commit.svg"
- width={30}
- />
- </div>
- <div>
- <p
- className="little-spacer-bottom"
- >
- <strong>
- onboarding.tutorial.with.jenkins.commit
- </strong>
- </p>
- <p>
- onboarding.tutorial.with.jenkins.commit.why
- </p>
- </div>
- </div>
- <div
- className="display-flex-row huge-spacer-bottom"
- >
- <div>
- <img
- alt=""
- className="big-spacer-right"
- src="/images/tutorials/refresh.svg"
- width={30}
- />
- </div>
- <div>
- <p
- className="little-spacer-bottom"
- >
- <strong>
- onboarding.tutorial.with.jenkins.refresh
- </strong>
- </p>
- <p>
- onboarding.tutorial.with.jenkins.refresh.why
- </p>
- </div>
- </div>
- </div>
+ <Connect(withAppState(AllSet)) />
</React.Fragment>
</div>
`;
<hr
className="huge-spacer-top huge-spacer-bottom"
/>
- <div
- className="abs-width-600"
- >
- <p
- className="big-spacer-bottom"
- >
- <SentenceWithHighlights
- highlightKeys={
- Array [
- "all_set",
- ]
- }
- translationKey="onboarding.tutorial.with.jenkins.all_set"
- />
- </p>
- <div
- className="display-flex-row big-spacer-bottom"
- >
- <div>
- <img
- alt=""
- className="big-spacer-right"
- src="/images/tutorials/commit.svg"
- width={30}
- />
- </div>
- <div>
- <p
- className="little-spacer-bottom"
- >
- <strong>
- onboarding.tutorial.with.jenkins.commit
- </strong>
- </p>
- <p>
- onboarding.tutorial.with.jenkins.commit.why
- </p>
- </div>
- </div>
- <div
- className="display-flex-row huge-spacer-bottom"
- >
- <div>
- <img
- alt=""
- className="big-spacer-right"
- src="/images/tutorials/refresh.svg"
- width={30}
- />
- </div>
- <div>
- <p
- className="little-spacer-bottom"
- >
- <strong>
- onboarding.tutorial.with.jenkins.refresh
- </strong>
- </p>
- <p>
- onboarding.tutorial.with.jenkins.refresh.why
- </p>
- </div>
- </div>
- </div>
+ <Connect(withAppState(AllSet)) />
</React.Fragment>
</div>
`;
<hr
className="huge-spacer-top huge-spacer-bottom"
/>
- <div
- className="abs-width-600"
- >
- <p
- className="big-spacer-bottom"
- >
- <SentenceWithHighlights
- highlightKeys={
- Array [
- "all_set",
- ]
- }
- translationKey="onboarding.tutorial.with.jenkins.all_set"
- />
- </p>
- <div
- className="display-flex-row big-spacer-bottom"
- >
- <div>
- <img
- alt=""
- className="big-spacer-right"
- src="/images/tutorials/commit.svg"
- width={30}
- />
- </div>
- <div>
- <p
- className="little-spacer-bottom"
- >
- <strong>
- onboarding.tutorial.with.jenkins.commit
- </strong>
- </p>
- <p>
- onboarding.tutorial.with.jenkins.commit.why
- </p>
- </div>
- </div>
- <div
- className="display-flex-row huge-spacer-bottom"
- >
- <div>
- <img
- alt=""
- className="big-spacer-right"
- src="/images/tutorials/refresh.svg"
- width={30}
- />
- </div>
- <div>
- <p
- className="little-spacer-bottom"
- >
- <strong>
- onboarding.tutorial.with.jenkins.refresh
- </strong>
- </p>
- <p>
- onboarding.tutorial.with.jenkins.refresh.why
- </p>
- </div>
- </div>
- </div>
- </React.Fragment>
-</div>
-`;
-
-exports[`should render correctly with no branches 1`] = `
-<div
- className="boxed-group-inner"
->
- <ol
- className="list-styled"
- >
- <li>
- onboarding.build
- <RenderOptions
- checked="gradle"
- name="buildtool"
- onCheck={[Function]}
- optionLabelKey="onboarding.build"
- options={
- Array [
- "maven",
- "gradle",
- "dotnet",
- "other",
- ]
- }
- />
- </li>
- <Gradle
- component={
- Object {
- "breadcrumbs": Array [],
- "key": "my-project",
- "name": "MyProject",
- "qualifier": "TRK",
- "qualityGate": Object {
- "isDefault": true,
- "key": "30",
- "name": "Sonar way",
- },
- "qualityProfiles": Array [
- Object {
- "deleted": false,
- "key": "my-qp",
- "language": "ts",
- "name": "Sonar way",
- },
- ],
- "tags": Array [],
- }
- }
- />
- </ol>
- <React.Fragment>
- <hr
- className="huge-spacer-top huge-spacer-bottom"
- />
- <div
- className="abs-width-600"
- >
- <p
- className="big-spacer-bottom"
- >
- <SentenceWithHighlights
- highlightKeys={
- Array [
- "all_set",
- ]
- }
- translationKey="onboarding.tutorial.with.jenkins.all_set"
- />
- </p>
- <div
- className="display-flex-row big-spacer-bottom"
- >
- <div>
- <img
- alt=""
- className="big-spacer-right"
- src="/images/tutorials/commit.svg"
- width={30}
- />
- </div>
- <div>
- <p
- className="little-spacer-bottom"
- >
- <strong>
- onboarding.tutorial.with.jenkins.commit
- </strong>
- </p>
- <p>
- onboarding.tutorial.with.jenkins.commit.why.no_branches
- </p>
- </div>
- </div>
- <div
- className="display-flex-row huge-spacer-bottom"
- >
- <div>
- <img
- alt=""
- className="big-spacer-right"
- src="/images/tutorials/refresh.svg"
- width={30}
- />
- </div>
- <div>
- <p
- className="little-spacer-bottom"
- >
- <strong>
- onboarding.tutorial.with.jenkins.refresh
- </strong>
- </p>
- <p>
- onboarding.tutorial.with.jenkins.refresh.why
- </p>
- </div>
- </div>
- </div>
+ <Connect(withAppState(AllSet)) />
</React.Fragment>
</div>
`;
import * as React from 'react';
import CodeSnippet from '../../../common/CodeSnippet';
import SentenceWithFilename from '../../components/SentenceWithFilename';
+import { buildGradleSnippet } from '../../utils';
import CreateJenkinsfileBulletPoint from './CreateJenkinsfileBulletPoint';
export interface GradleProps {
component: T.Component;
}
-const buildGradleSnippet = (key: string) => `plugins {
- id "org.sonarqube" version "3.1.1"
-}
-
-sonarqube {
- properties {
- property "sonar.projectKey", "${key}"
- }
-}`;
-
const JENKINSFILE_SNIPPET = `node {
stage('SCM') {
checkout scm
import * as React from 'react';
import CodeSnippet from '../../../common/CodeSnippet';
import SentenceWithFilename from '../../components/SentenceWithFilename';
+import { mavenPomSnippet } from '../../utils';
import CreateJenkinsfileBulletPoint from './CreateJenkinsfileBulletPoint';
export interface MavenProps {
component: T.Component;
}
-const pomSnippet = (key: string) => `<properties>
- <sonar.projectKey>${key}</sonar.projectKey>
-</properties>`;
-
const JENKINSFILE_SNIPPET = `node {
stage('SCM') {
checkout scm
filename="pom.xml"
translationKey="onboarding.tutorial.with.jenkins.jenkinsfile.maven.step2"
/>
- <CodeSnippet snippet={pomSnippet(component.key)} />
+ <CodeSnippet snippet={mavenPomSnippet(component.key)} />
</li>
<CreateJenkinsfileBulletPoint
alertTranslationKeyPart="onboarding.tutorial.with.jenkins.jenkinsfile.maven.step3"
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
import * as React from 'react';
-import CodeSnippet from '../../../common/CodeSnippet';
-import SentenceWithFilename from '../../components/SentenceWithFilename';
+import DefaultProjectKey from '../../components/DefaultProjectKey';
import CreateJenkinsfileBulletPoint from './CreateJenkinsfileBulletPoint';
export interface OtherProps {
component: T.Component;
}
-const sonarProjectSnippet = (key: string) => `sonar.projectKey=${key}`;
-
const JENKINSFILE_SNIPPET = `node {
stage('SCM') {
checkout scm
export default function Other({ component }: OtherProps) {
return (
<>
- <li className="abs-width-600">
- <SentenceWithFilename
- filename="sonar-project.properties"
- translationKey="onboarding.tutorial.with.jenkins.jenkinsfile.other.step2"
- />
- <CodeSnippet snippet={sonarProjectSnippet(component.key)} />
- </li>
+ <DefaultProjectKey component={component} />
<CreateJenkinsfileBulletPoint
alertTranslationKeyPart="onboarding.tutorial.with.jenkins.jenkinsfile.other.step3"
snippet={JENKINSFILE_SNIPPET}
exports[`should render correctly 1`] = `
<Fragment>
- <li
- className="abs-width-600"
- >
- <SentenceWithFilename
- filename="sonar-project.properties"
- translationKey="onboarding.tutorial.with.jenkins.jenkinsfile.other.step2"
- />
- <CodeSnippet
- snippet="sonar.projectKey=my-project"
- />
- </li>
+ <DefaultProjectKey
+ component={
+ Object {
+ "breadcrumbs": Array [],
+ "key": "my-project",
+ "name": "MyProject",
+ "qualifier": "TRK",
+ "qualityGate": Object {
+ "isDefault": true,
+ "key": "30",
+ "name": "Sonar way",
+ },
+ "qualityProfiles": Array [
+ Object {
+ "deleted": false,
+ "key": "my-qp",
+ "language": "ts",
+ "name": "Sonar way",
+ },
+ ],
+ "tags": Array [],
+ }
+ }
+ />
<CreateJenkinsfileBulletPoint
alertTranslationKeyPart="onboarding.tutorial.with.jenkins.jenkinsfile.other.step3"
snippet="node {
Manual = 'manual',
Jenkins = 'jenkins',
GitLabCI = 'gitlab-ci',
+ GitHubActions = 'github-actions',
AzurePipelines = 'azure-pipelines'
}
return os === 'win' ? (s: string) => `"${s}"` : (s: string) => s;
}
+export function mavenPomSnippet(key: string) {
+ return `<properties>
+ <sonar.projectKey>${key}</sonar.projectKey>
+</properties>`;
+}
+
+export function buildGradleSnippet(key: string) {
+ return `plugins {
+ id "org.sonarqube" version "3.1.1"
+}
+
+sonarqube {
+ properties {
+ property "sonar.projectKey", "${key}"
+ }
+}`;
+}
+
export function getUniqueTokenName(tokens: T.UserToken[], initialTokenName = '') {
const hasToken = (name: string) => tokens.find(token => token.name === name) !== undefined;
onboarding.token.use_existing_token.label=Existing token value
onboarding.token.invalid_format=The token you have entered has invalid format.
+onboarding.tutorial.env_variables=In the {field} field, enter {value} {extra}
+onboarding.tutorial.env_variables.field=Value
+onboarding.tutorial.env_variables.token_generator.value=an existing token, or a newly generated one:
+
onboarding.analysis.header=Run analysis on your project
onboarding.analysis.auto_refresh_after_analysis=Once the analysis is completed, this page will automatically refresh and you will be able to browse the analysis results.
onboarding.analysis.dotnetcore.global.text.path=Make sure dotnet tools folder is in your path. See dotnet global tools documentation for more information.
onboarding.tutorial.return_to_list=Choose another option
+onboarding.tutorial.ci_outro.all_set.sentence={all_set} and ready to improve the quality and security of your code!
+onboarding.tutorial.ci_outro.all_set.sentence.all_set=You're all set
+onboarding.tutorial.ci_outro.commit=Commit and push your code to start the analysis.
+onboarding.tutorial.ci_outro.commit.why=Each new push you make on your branches or pull requests will trigger a new analysis in SonarQube.
+onboarding.tutorial.ci_outro.commit.why.no_branches=Each new push you make on your main branch will trigger a new analysis in SonarQube.
+onboarding.tutorial.ci_outro.refresh=This page will then refresh with your analysis results.
+onboarding.tutorial.ci_outro.refresh.why=If the page doesn't refresh after a while, please double-check the analysis configuration.
+onboarding.tutorial.other.project_key.sentence=Create a {file} file in your repository and paste the following code:
onboarding.tutorial.choose_method=How do you want to analyze your repository?
onboarding.tutorial.choose_method.manual=Manually
onboarding.tutorial.choose_method.jenkins=With Jenkins
+onboarding.tutorial.choose_method.github_action=With GitHub Actions
onboarding.tutorial.choose_method.gitlab_ci=With GitLab CI
onboarding.tutorial.choose_method.azure_pipelines=With Azure Pipelines
+onboarding.tutorial.with.github_action.create_secret.title=Create GitHub Secrets
+onboarding.tutorial.with.github_action.secret.intro=In your GitHub repository, go to {settings_secret} and create two new secrets:
+onboarding.tutorial.with.github_action.secret.intro.link=Settings > Secrets
+onboarding.tutorial.with.github_action.secret.name.sentence=In the {name} field, enter
+onboarding.tutorial.with.github_action.secret.name.sentence.name=Name
+onboarding.tutorial.with.github_action.secret.new.sentence=Click on {new_secret}
+onboarding.tutorial.with.github_action.secret.new.sentence.new_secret=New repository secret
+onboarding.tutorial.with.github_action.secret.add.sentence=Click on {add_secret}
+onboarding.tutorial.with.github_action.secret.add.sentence.add_secret=Add secret
+onboarding.tutorial.with.github_action.yaml.title=Create Workflow YAML File
+onboarding.tutorial.with.github_action.yaml.create_yml=Create or update your {file} YAML file with the following content:
+onboarding.tutorial.with.github_action.yaml.maven.pom=Update your {pom} file with the following properties:
+onboarding.tutorial.with.github_action.yaml.gradle=Update your {gradle} file with the {sq} plugin and it's configuration:
+
+
onboarding.tutorial.with.gitlab_ci.title=Analyze your project with GitLab CI
onboarding.tutorial.with.gitlab_ci.unsupported=This tutorial is only available for projects bound to GitLab.
onboarding.tutorial.with.gitlab_ci.project_key.title=Set your project key
onboarding.tutorial.with.gitlab_ci.env_variables.title=Add environment variables
-onboarding.tutorial.with.gitlab_ci.env_variables.enter_field_value=In the {field} field, enter {value} {extra}
onboarding.tutorial.with.gitlab_ci.env_variables.description.link=Settings > CI/CD > Variables
onboarding.tutorial.with.gitlab_ci.env_variables.section.title=a. Define the SonarQube Token environment variable
onboarding.tutorial.with.gitlab_ci.env_variables.section.description=In GitLab, go to {link} to add the following variable and make sure it is available for your project:
onboarding.tutorial.with.gitlab_ci.env_variables.edit.token.tooltip=Use an existing token or generate a new one.
onboarding.tutorial.with.gitlab_ci.env_variables.step1=Key
-onboarding.tutorial.with.gitlab_ci.env_variables.step2=Value
-onboarding.tutorial.with.gitlab_ci.env_variables.section.step2.value=an existing token, or a newly generated one:
+
onboarding.tutorial.with.gitlab_ci.env_variables.step3=Uncheck the "Protect Variable" checkbox
onboarding.tutorial.with.gitlab_ci.env_variables.section.step4=Check the "Mask Variable" checkbox
onboarding.tutorial.with.gitlab_ci.env_variables.section2.title=b. Define the SonarQube URL environment variable
onboarding.tutorial.with.jenkins.dotnet.scanner.prereqs.step5.sentence.install_from=Install from GitHub
onboarding.tutorial.with.jenkins.dotnet.scanner.prereqs.step5.sentence.install_auto=Install automatically
-onboarding.tutorial.with.jenkins.jenkinsfile.other.step2.sentence=Create a {file} file in your repository and paste the following code:
onboarding.tutorial.with.jenkins.jenkinsfile.other.step3.replace.sentence=Make sure to replace {default} with the name you gave to your SonarQube Scanner tool {in_jenkins}.
onboarding.tutorial.with.jenkins.jenkinsfile.other.step3.replace.sentence.default=SonarScanner
onboarding.tutorial.with.jenkins.jenkinsfile.other.step3.replace.sentence.in_jenkins=in Jenkins
onboarding.tutorial.with.jenkins.jenkinsfile.other.step3.help2.sentence=The name is located under the {path} section, in the {name} field.
onboarding.tutorial.with.jenkins.jenkinsfile.other.step3.help2.sentence.path=SonarQube Scanner > SonarQube Scanner installations
onboarding.tutorial.with.jenkins.jenkinsfile.other.step3.help2.sentence.name=Name
-onboarding.tutorial.with.jenkins.all_set.sentence={all_set} and ready to improve the quality and security of your code!
-onboarding.tutorial.with.jenkins.all_set.sentence.all_set=You're all set
-onboarding.tutorial.with.jenkins.commit=Commit and push your code to start the analysis.
-onboarding.tutorial.with.jenkins.commit.why=Each new push you make on your branches or pull requests will trigger a new analysis in SonarQube.
-onboarding.tutorial.with.jenkins.commit.why.no_branches=Each new push you make on your main branch will trigger a new analysis in SonarQube.
-onboarding.tutorial.with.jenkins.refresh=This page will then refresh with your analysis results.
-onboarding.tutorial.with.jenkins.refresh.why=If the page doesn't refresh after a while, please double-check the analysis configuration.
+
onboarding.tutorial.with.azure_pipelines.os=What is your agent host?
onboarding.tutorial.with.azure_pipelines.title=Analyze your project with Azure DevOps Pipelines
onboarding.tutorial.with.azure_pipelines.ServiceEndpoint.step5.sentence=Enter an existing token, or a newly generated one
onboarding.tutorial.with.azure_pipelines.ServiceEndpoint.step6.sentence=Create the service connection
onboarding.tutorial.with.azure_pipelines.BranchAnalysis.title=Configure analysis
-onboarding.tutorial.with.azure_pipelines.BranchAnalysis.info=The following steps assume you are using the Azure Pipelines classic editor. Check out our {doc_link} for the yaml counterpart.
+onboarding.tutorial.with.azure_pipelines.BranchAnalysis.info=The following steps assume you are using the Azure Pipelines classic editor. Check out our {doc_link} for the YAML counterpart.
onboarding.tutorial.with.azure_pipelines.BranchAnalysis.info.doc_link=Azure DevOps integration page
onboarding.tutorial.with.azure_pipelines.BranchAnalysis.build_wrapper.ccpp.sentence=In Azure DevOps, create or edit a build {pipeline} to make Build Wrapper available on the build agent.