Browse Source

SONAR-14432 SonarQube support Azure DevOps Services

tags/8.7.0.41497
Philippe Perrin 3 years ago
parent
commit
3bb16bc152

+ 1
- 1
server/sonar-web/src/main/js/apps/settings/components/almIntegration/AlmIntegrationRenderer.tsx View File

@@ -92,7 +92,7 @@ const tabs = [
height={16}
src={`${getBaseUrl()}/images/alm/azure.svg`}
/>
Azure DevOps Server
Azure DevOps
</>
),
requiresBranchesEnabled: false

+ 7
- 2
server/sonar-web/src/main/js/apps/settings/components/almIntegration/AzureForm.tsx View File

@@ -48,9 +48,14 @@ export default function AzureForm(props: AzureFormProps) {
<AlmBindingDefinitionFormField
help={
<>
{translate('settings.almintegration.form.url.azure.help')}
{translate('settings.almintegration.form.url.azure.help1')}
<br />
<em>https://ado.your-company.com/DefaultCollection</em>
<em>https://ado.your-company.com/your_collection</em>
<br />
<br />
{translate('settings.almintegration.form.url.azure.help2')}
<br />
<em>https://dev.azure.com/your_organization</em>
</>
}
id="url.azure"

+ 6
- 6
server/sonar-web/src/main/js/apps/settings/components/almIntegration/__tests__/__snapshots__/AlmIntegrationRenderer-test.tsx.snap View File

@@ -56,7 +56,7 @@ exports[`should render correctly: azure 1`] = `
height={16}
src="/images/alm/azure.svg"
/>
Azure DevOps Server
Azure DevOps
</React.Fragment>,
"requiresBranchesEnabled": false,
},
@@ -146,7 +146,7 @@ exports[`should render correctly: bitbucket 1`] = `
height={16}
src="/images/alm/azure.svg"
/>
Azure DevOps Server
Azure DevOps
</React.Fragment>,
"requiresBranchesEnabled": false,
},
@@ -236,7 +236,7 @@ exports[`should render correctly: default 1`] = `
height={16}
src="/images/alm/azure.svg"
/>
Azure DevOps Server
Azure DevOps
</React.Fragment>,
"requiresBranchesEnabled": false,
},
@@ -326,7 +326,7 @@ exports[`should render correctly: delete modal 1`] = `
height={16}
src="/images/alm/azure.svg"
/>
Azure DevOps Server
Azure DevOps
</React.Fragment>,
"requiresBranchesEnabled": false,
},
@@ -421,7 +421,7 @@ exports[`should render correctly: gitlab 1`] = `
height={16}
src="/images/alm/azure.svg"
/>
Azure DevOps Server
Azure DevOps
</React.Fragment>,
"requiresBranchesEnabled": false,
},
@@ -511,7 +511,7 @@ exports[`should render correctly: loading 1`] = `
height={16}
src="/images/alm/azure.svg"
/>
Azure DevOps Server
Azure DevOps
</React.Fragment>,
"requiresBranchesEnabled": false,
},

+ 18
- 4
server/sonar-web/src/main/js/apps/settings/components/almIntegration/__tests__/__snapshots__/AzureForm-test.tsx.snap View File

@@ -13,10 +13,17 @@ exports[`should render correctly: create 1`] = `
<AlmBindingDefinitionFormField
help={
<React.Fragment>
settings.almintegration.form.url.azure.help
settings.almintegration.form.url.azure.help1
<br />
<em>
https://ado.your-company.com/DefaultCollection
https://ado.your-company.com/your_collection
</em>
<br />
<br />
settings.almintegration.form.url.azure.help2
<br />
<em>
https://dev.azure.com/your_organization
</em>
</React.Fragment>
}
@@ -51,10 +58,17 @@ exports[`should render correctly: edit 1`] = `
<AlmBindingDefinitionFormField
help={
<React.Fragment>
settings.almintegration.form.url.azure.help
settings.almintegration.form.url.azure.help1
<br />
<em>
https://ado.your-company.com/your_collection
</em>
<br />
<br />
settings.almintegration.form.url.azure.help2
<br />
<em>
https://ado.your-company.com/DefaultCollection
https://dev.azure.com/your_organization
</em>
</React.Fragment>
}

+ 5
- 4
server/sonar-web/src/main/js/apps/settings/components/pullRequestDecorationBinding/AlmSpecificForm.tsx View File

@@ -23,6 +23,7 @@ import { Link } from 'react-router';
import HelpTooltip from 'sonar-ui-common/components/controls/HelpTooltip';
import { Alert } from 'sonar-ui-common/components/ui/Alert';
import { translate } from 'sonar-ui-common/helpers/l10n';
import { ALM_DOCUMENTATION_PATHS } from '../../../../helpers/constants';
import { AlmKeys, ProjectAlmBindingResponse } from '../../../../types/alm-settings';
import InputForBoolean from '../inputs/InputForBoolean';

@@ -178,7 +179,7 @@ export default function AlmSpecificForm(props: AlmSpecificFormProps) {
propKey: 'repository',
value: repository || ''
})}
{renderMonoRepoFieldWithDocLink('/documentation/analysis/azuredevops-integration/')}
{renderMonoRepoFieldWithDocLink(ALM_DOCUMENTATION_PATHS[AlmKeys.Azure])}
</>
);
case AlmKeys.Bitbucket:
@@ -216,7 +217,7 @@ export default function AlmSpecificForm(props: AlmSpecificFormProps) {
propKey: 'slug',
value: slug || ''
})}
{renderMonoRepoFieldWithDocLink('/documentation/analysis/bitbucket-integration/')}
{renderMonoRepoFieldWithDocLink(ALM_DOCUMENTATION_PATHS[AlmKeys.Bitbucket])}
</>
);
case AlmKeys.GitHub:
@@ -237,7 +238,7 @@ export default function AlmSpecificForm(props: AlmSpecificFormProps) {
propKey: 'summaryCommentEnabled',
value: summaryCommentEnabled === undefined ? true : summaryCommentEnabled
})}
{renderMonoRepoFieldWithDocLink('/documentation/analysis/github-integration/')}
{renderMonoRepoFieldWithDocLink(ALM_DOCUMENTATION_PATHS[AlmKeys.GitHub])}
</>
);
case AlmKeys.GitLab:
@@ -249,7 +250,7 @@ export default function AlmSpecificForm(props: AlmSpecificFormProps) {
propKey: 'repository',
value: repository || ''
})}
{renderMonoRepoFieldWithDocLink('/documentation/analysis/gitlab-integration/')}
{renderMonoRepoFieldWithDocLink(ALM_DOCUMENTATION_PATHS[AlmKeys.GitLab])}
</>
);
default:

+ 26
- 7
server/sonar-web/src/main/js/components/tutorials/azure-pipelines/BranchAnalysisStepContent.tsx View File

@@ -23,6 +23,8 @@ import { Link } from 'react-router';
import { ClipboardIconButton } from 'sonar-ui-common/components/controls/clipboard';
import { Alert } from 'sonar-ui-common/components/ui/Alert';
import { translate, translateWithParameters } from 'sonar-ui-common/helpers/l10n';
import { ALM_DOCUMENTATION_PATHS } from '../../../helpers/constants';
import { AlmKeys } from '../../../types/alm-settings';
import CodeSnippet from '../../common/CodeSnippet';
import { withAppState } from '../../hoc/withAppState';
import RenderOptions from '../components/RenderOptions';
@@ -71,9 +73,26 @@ sonar.projectKey=${component.key}`;
optionLabelKey="onboarding.build"
options={Object.values(BuildTechnology)}
/>
<ol className="list-styled big-spacer-top">
{buildTechnology && (
<>
{buildTechnology && (
<>
<Alert variant="info" className="big-spacer-top">
<FormattedMessage
id="onboarding.tutorial.with.azure_pipelines.BranchAnalysis.info"
defaultMessage={translate(
'onboarding.tutorial.with.azure_pipelines.BranchAnalysis.info'
)}
values={{
doc_link: (
<Link to={ALM_DOCUMENTATION_PATHS[AlmKeys.Azure]} target="_blank">
{translate(
'onboarding.tutorial.with.azure_pipelines.BranchAnalysis.info.doc_link'
)}
</Link>
)
}}
/>
</Alert>
<ol className="list-styled big-spacer-top">
<li>
<SentenceWithHighlights
translationKey="onboarding.tutorial.with.azure_pipelines.BranchAnalysis.prepare"
@@ -203,7 +222,7 @@ sonar.projectKey=${component.key}`;
)}
values={{
link: (
<Link to="/documentation/analysis/azuredevops-integration/" target="_blank">
<Link to={ALM_DOCUMENTATION_PATHS[AlmKeys.Azure]} target="_blank">
{translate(
'onboarding.tutorial.with.azure_pipelines.BranchAnalysis.branch_protection.link'
)}
@@ -213,9 +232,9 @@ sonar.projectKey=${component.key}`;
/>
</>
)}
</>
)}
</ol>
</ol>
</>
)}
</>
);
}

+ 84
- 6
server/sonar-web/src/main/js/components/tutorials/azure-pipelines/__tests__/__snapshots__/BranchAnalysisStepContent-test.tsx.snap View File

@@ -18,9 +18,6 @@ exports[`should render correctly: branches enabled 1`] = `
]
}
/>
<ol
className="list-styled big-spacer-top"
/>
</Fragment>
`;

@@ -42,9 +39,6 @@ exports[`should render correctly: branches not enabled 1`] = `
]
}
/>
<ol
className="list-styled big-spacer-top"
/>
</Fragment>
`;

@@ -67,6 +61,27 @@ exports[`should render correctly: dotnet 1`] = `
]
}
/>
<Alert
className="big-spacer-top"
variant="info"
>
<FormattedMessage
defaultMessage="onboarding.tutorial.with.azure_pipelines.BranchAnalysis.info"
id="onboarding.tutorial.with.azure_pipelines.BranchAnalysis.info"
values={
Object {
"doc_link": <Link
onlyActiveOnIndex={false}
style={Object {}}
target="_blank"
to="/documentation/analysis/azuredevops-integration/"
>
onboarding.tutorial.with.azure_pipelines.BranchAnalysis.info.doc_link
</Link>,
}
}
/>
</Alert>
<ol
className="list-styled big-spacer-top"
>
@@ -208,6 +223,27 @@ exports[`should render correctly: gradle 1`] = `
]
}
/>
<Alert
className="big-spacer-top"
variant="info"
>
<FormattedMessage
defaultMessage="onboarding.tutorial.with.azure_pipelines.BranchAnalysis.info"
id="onboarding.tutorial.with.azure_pipelines.BranchAnalysis.info"
values={
Object {
"doc_link": <Link
onlyActiveOnIndex={false}
style={Object {}}
target="_blank"
to="/documentation/analysis/azuredevops-integration/"
>
onboarding.tutorial.with.azure_pipelines.BranchAnalysis.info.doc_link
</Link>,
}
}
/>
</Alert>
<ol
className="list-styled big-spacer-top"
>
@@ -356,6 +392,27 @@ exports[`should render correctly: maven 1`] = `
]
}
/>
<Alert
className="big-spacer-top"
variant="info"
>
<FormattedMessage
defaultMessage="onboarding.tutorial.with.azure_pipelines.BranchAnalysis.info"
id="onboarding.tutorial.with.azure_pipelines.BranchAnalysis.info"
values={
Object {
"doc_link": <Link
onlyActiveOnIndex={false}
style={Object {}}
target="_blank"
to="/documentation/analysis/azuredevops-integration/"
>
onboarding.tutorial.with.azure_pipelines.BranchAnalysis.info.doc_link
</Link>,
}
}
/>
</Alert>
<ol
className="list-styled big-spacer-top"
>
@@ -504,6 +561,27 @@ exports[`should render correctly: other 1`] = `
]
}
/>
<Alert
className="big-spacer-top"
variant="info"
>
<FormattedMessage
defaultMessage="onboarding.tutorial.with.azure_pipelines.BranchAnalysis.info"
id="onboarding.tutorial.with.azure_pipelines.BranchAnalysis.info"
values={
Object {
"doc_link": <Link
onlyActiveOnIndex={false}
style={Object {}}
target="_blank"
to="/documentation/analysis/azuredevops-integration/"
>
onboarding.tutorial.with.azure_pipelines.BranchAnalysis.info.doc_link
</Link>,
}
}
/>
</Alert>
<ol
className="list-styled big-spacer-top"
>

+ 20
- 18
sonar-core/src/main/resources/org/sonar/l10n/core.properties View File

@@ -359,7 +359,7 @@ Sa=Sa
#
#------------------------------------------------------------------------------

alm.azure=Azure DevOps Server
alm.azure=Azure DevOps
alm.azure.short=Azure DevOps
alm.bitbucket=Bitbucket Server
alm.bitbucket.short=Bitbucket
@@ -1086,7 +1086,6 @@ settings.almintegration.check_configuration=Check configuration
settings.almintegration.checking_configuration=Checking configuration
settings.almintegration.configuration_valid=Configuration valid
settings.almintegration.could_not_validate=Could not validate this configuration.
settings.almintegration.no_validation=SonarQube doesn't currently validate Azure DevOps Server configurations.
settings.almintegration.delete.header=Delete configuration
settings.almintegration.delete.message=Are you sure you want to delete the {id} configuration?
settings.almintegration.delete.info={0} projects will no longer get Pull Request Decorations.
@@ -1102,8 +1101,9 @@ settings.almintegration.form.name.github=Configuration name
settings.almintegration.form.name.github.help=Give your configuration a clear and succinct name. This name will be used at project level to identify the correct configured GitHub App for a project.
settings.almintegration.form.name.gitlab=Configuration name
settings.almintegration.form.name.gitlab.help=Give your configuration a clear and succinct name. This name will be used at project level to identify the correct configured GitLab instance for a project.
settings.almintegration.form.url.azure=Azure DevOps Server collection URL
settings.almintegration.form.url.azure.help=Provide the full Azure DevOps Server collection URL. For example:
settings.almintegration.form.url.azure=Azure DevOps URL
settings.almintegration.form.url.azure.help1=For Azure DevOps Server, provide the full collection URL:
settings.almintegration.form.url.azure.help2=For Azure DevOps Services, provide the full organization URL:
settings.almintegration.form.url.bitbucket=Bitbucket Server URL
settings.almintegration.form.url.bitbucket.help=Example: {example}
settings.almintegration.form.url.github=GitHub API URL
@@ -1145,9 +1145,9 @@ settings.pr_decoration.binding.form.monorepo=Enable mono repository support
settings.pr_decoration.binding.form.monorepo.help=Enable this setting if your project is part of a mono repository. {doc_link}
settings.pr_decoration.binding.form.monorepo.warning=This setting must be enabled for all SonarQube projects that are part of a mono repository.
settings.pr_decoration.binding.form.azure.project=Project Name
settings.pr_decoration.binding.form.azure.project.help=The name of the Azure DevOps Server project containing your repository.
settings.pr_decoration.binding.form.azure.project.help=The name of the Azure DevOps project containing your repository.
settings.pr_decoration.binding.form.azure.repository=Repository Name
settings.pr_decoration.binding.form.azure.repository.help=The name of your Azure DevOps Server repository.
settings.pr_decoration.binding.form.azure.repository.help=The name of your Azure DevOps repository.
settings.pr_decoration.binding.form.github.repository=Repository identifier
settings.pr_decoration.binding.form.github.repository.help=The path of your repository URL. Example: {example}
settings.pr_decoration.binding.form.github.summary_comment_setting=Enable analysis summary under the GitHub Conversation tab
@@ -3144,7 +3144,7 @@ footer.web_api=Web API
# ONBOARDING
#
#------------------------------------------------------------------------------
onboarding.alm.azure=Azure DevOps Server
onboarding.alm.azure=Azure DevOps
onboarding.alm.bitbucket=Bitbucket Server
onboarding.alm.gitlab=GitLab

@@ -3157,7 +3157,7 @@ onboarding.create_project.help_set_up_x=Learn more on how to set up {0}

onboarding.create_project.setup_manually=Create a project
onboarding.create_project.select_method.manual=Manually
onboarding.create_project.select_method.azure=From Azure DevOps Server
onboarding.create_project.select_method.azure=From Azure DevOps
onboarding.create_project.select_method.bitbucket=From Bitbucket Server
onboarding.create_project.select_method.github=From GitHub
onboarding.create_project.select_method.gitlab=From GitLab
@@ -3187,10 +3187,10 @@ onboarding.create_project.from_bbs=Create a project from Bitbucket Server

onboarding.create_application.key.description=If specified, this value is used as the key instead of generating it from the name of the Application. Only letters, digits, dashes and underscores can be used.

onboarding.create_project.pat_form.title.azure=Allow SonarQube to access and list your Azure DevOps Server repositories
onboarding.create_project.pat_form.title.azure=Allow SonarQube to access and list your Azure DevOps repositories
onboarding.create_project.pat_form.title.bitbucket=Grant access to your repositories
onboarding.create_project.pat_form.title.gitlab=Grant access to your projects
onboarding.create_project.pat_form.help.azure=SonarQube needs a personal access token to access and list your repositories from Azure DevOps Server.
onboarding.create_project.pat_form.help.azure=SonarQube needs a personal access token to access and list your repositories from Azure DevOps.
onboarding.create_project.pat_form.help.bitbucket=SonarQube needs a personal access token to access and list your repositories from Bitbucket Server.
onboarding.create_project.pat_form.help.gitlab=SonarQube needs a personal access token to access and list your projects from GitLab.
onboarding.create_project.pat_form.pat_required=Please enter a personal access token
@@ -3213,7 +3213,7 @@ onboarding.create_project.pat_incorrect.bitbucket=Your personal access couldn't
onboarding.create_project.pat_incorrect.gitlab=Your personal access couldn't be validated. Please make sure it has the right scope and that it is not expired.
onboarding.create_project.pat_help.title=How to create a personal access token?

onboarding.create_project.pat_help.instructions.azure=Create and provide an Azure DevOps Server {link}. You need to select the {scope} scope so we can display a list of your repositories which are available for analysis.
onboarding.create_project.pat_help.instructions.azure=Create and provide an Azure DevOps {link}. You need to select the {scope} scope so we can display a list of your repositories which are available for analysis.
onboarding.create_project.pat_help.instructions.link.azure=personal access token

onboarding.create_project.pat_help.instructions=Click the following link to generate a token in {alm}, and copy-paste it into the personal access token field.
@@ -3234,8 +3234,8 @@ onboarding.create_project.only_showing_X_first_repos=We're only displaying the f
onboarding.create_project.import_selected_repo=Set up selected repository
onboarding.create_project.go_to_project=Go to project

onboarding.create_project.azure.title=Which Azure DevOps Server repository do you want to set up?
onboarding.create_project.azure.no_projects=No projects could be fetched from Azure DevOps Server. Contact your system administrator, or {link}.
onboarding.create_project.azure.title=Which Azure DevOps repository do you want to set up?
onboarding.create_project.azure.no_projects=No projects could be fetched from Azure DevOps. Contact your system administrator, or {link}.
onboarding.create_project.azure.no_repositories=Could not fetch repositories for this project. Contact your system administrator, or {link}.
onboarding.create_project.azure.no_results=No repositories match your search query.
onboarding.create_project.github.title=Which GitHub repository do you want to set up?
@@ -3513,13 +3513,13 @@ onboarding.tutorial.with.jenkins.refresh=This page will then refresh with your a
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.title=Analyze your project with Azure DevOps Pipelines
onboarding.tutorial.with.azure_pipelines.unsupported=This tutorial is only available for projects bound to Azure DevOps Server.
onboarding.tutorial.with.azure_pipelines.ExtensionInstallation.title=Install SonarQube extension for Azure DevOps Server
onboarding.tutorial.with.azure_pipelines.ExtensionInstallation.sentence=From your Azure DevOps Server instance, navigate to the Visual Studio Marketplace and install the {link} by clicking the {button} button.
onboarding.tutorial.with.azure_pipelines.unsupported=This tutorial is only available for projects bound to Azure DevOps.
onboarding.tutorial.with.azure_pipelines.ExtensionInstallation.title=Install SonarQube extension for Azure DevOps
onboarding.tutorial.with.azure_pipelines.ExtensionInstallation.sentence=From your Azure DevOps instance, navigate to the Visual Studio Marketplace and install the {link} by clicking the {button} button.
onboarding.tutorial.with.azure_pipelines.ExtensionInstallation.sentence.link=SonarQube extension
onboarding.tutorial.with.azure_pipelines.ExtensionInstallation.sentence.button=Get it free
onboarding.tutorial.with.azure_pipelines.ServiceEndpoint.title=Add a new SonarQube Service Endpoint
onboarding.tutorial.with.azure_pipelines.ServiceEndpoint.step1.sentence=In Azure DevOps Server, go to {menu}
onboarding.tutorial.with.azure_pipelines.ServiceEndpoint.step1.sentence=In Azure DevOps, go to {menu}
onboarding.tutorial.with.azure_pipelines.ServiceEndpoint.step1.sentence.menu=Project settings > Service connections
onboarding.tutorial.with.azure_pipelines.ServiceEndpoint.step2.sentence=Add a new service connection of type {type}
onboarding.tutorial.with.azure_pipelines.ServiceEndpoint.step2.sentence.type=SonarQube
@@ -3528,7 +3528,9 @@ onboarding.tutorial.with.azure_pipelines.ServiceEndpoint.step4.sentence=Enter yo
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.prepare.sentence=In Azure DevOps Server, create or edit a {pipeline} and add a new {task} task {before} your build task
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.prepare.sentence=In Azure DevOps, create or edit a {pipeline} and add a new {task} task {before} your build task
onboarding.tutorial.with.azure_pipelines.BranchAnalysis.prepare.sentence.pipeline=Build Pipeline
onboarding.tutorial.with.azure_pipelines.BranchAnalysis.prepare.sentence.task=Prepare Analysis Configuration
onboarding.tutorial.with.azure_pipelines.BranchAnalysis.prepare.sentence.before=before

Loading…
Cancel
Save