Skip to content

Commit

Permalink
Merge branch 'dev' into liuqi/tlsVersionWarning
Browse files Browse the repository at this point in the history
  • Loading branch information
liuqidake authored Nov 1, 2024
2 parents 30add81 + 3430402 commit f0ac730
Show file tree
Hide file tree
Showing 13 changed files with 237 additions and 2,148 deletions.
1,856 changes: 149 additions & 1,707 deletions client-react/package-lock.json

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions client-react/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,6 @@
"jest-date-mock": "^1.0.10",
"jest-junit": "^6.4.0",
"jest-mock-axios": "^2.4.0",
"monaco-editor-webpack-plugin": "^1.9.1",
"prettier": "^2.8.8",
"react-test-renderer": "^17.0.2",
"typescript": "^5.3.3",
Expand Down Expand Up @@ -105,6 +104,7 @@
"yarn": "NO LONGER USED - Please use npm"
},
"overrides": {
"react": "17.0.2"
"react": "17.0.2",
"react-dom": "17.0.2"
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -76,3 +76,10 @@ export const bannerLinkStyle = (theme: ThemeExtended) =>
},
},
});

// NOTE(yoonaoh): The color of the link is set to the default Fluent UI link color.
// Using the statusBar link color from @fluentui/azure-themes instead
export const customBannerLinkStyle = (theme: ThemeExtended) =>
style({
color: theme?.semanticColors?.link?.toLowerCase() == '#0078d4' ? '#005A9E' : '#6CB8F6',
});
Original file line number Diff line number Diff line change
Expand Up @@ -164,6 +164,13 @@ export enum AuthType {
PublishProfile = 'publishprofile',
}

export enum RepoProvider {
TfsGit = 'tfsgit',
Git = 'git',
GitHub = 'github',
TfsVersionControl = 'tfsversioncontrol',
}

export interface AzureDevOpsUrl {
Tfs: string;
Sps: string;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import {
CodeDeploymentsRow,
KuduLogMessage,
UrlInfo,
RepoProvider,
} from '../DeploymentCenter.types';
import { ProgressIndicator } from '@fluentui/react/lib/ProgressIndicator';
import { PanelType } from '@fluentui/react/lib/Panel';
Expand Down Expand Up @@ -181,11 +182,13 @@ const DeploymentCenterVSTSCodeLogs: React.FC<DeploymentCenterCodeLogsProps> = pr
const urlInfo: UrlInfo[] = [];
if (messageJSON.commitId) {
const commitUrl: string = getCommitUrl(messageJSON);
urlInfo.push({
urlIcon: 'BranchCommit',
urlText: t('sourceVersionUrl').format(messageJSON.commitId.substr(0, 10)),
url: commitUrl,
});
if (commitUrl) {
urlInfo.push({
urlIcon: 'BranchCommit',
urlText: t('sourceVersionUrl').format(messageJSON.commitId.substring(0, 10)),
url: commitUrl,
});
}
}
if (messageJSON.buildNumber) {
const buildUrl: string = getBuildUrl(messageJSON);
Expand Down Expand Up @@ -253,14 +256,32 @@ const DeploymentCenterVSTSCodeLogs: React.FC<DeploymentCenterCodeLogsProps> = pr
};

const getCommitUrl = (messageJSON: KuduLogMessage) => {
if (messageJSON.commitId && messageJSON.repoProvider && messageJSON.repositoryUrl) {
if (messageJSON.repoProvider === ScmType.GitHub) {
return '{0}/commit/{1}'.format(messageJSON.repositoryUrl, messageJSON.commitId);
const { repoProvider, repositoryUrl, collectionUrl, teamProject, repoName, commitId } = messageJSON;
switch (repoProvider?.toLowerCase()) {
case RepoProvider.TfsGit:
case RepoProvider.Git:
case RepoProvider.GitHub: {
let repoUrl = repositoryUrl;
if (!repoUrl) {
if (collectionUrl && teamProject && repoName) {
repoUrl = '{0}{1}/_git/{2}'.format(collectionUrl, teamProject, repoName);
}
}
return repoUrl ? '{0}/commit/{1}'.format(repoUrl, commitId) : '';
}
case RepoProvider.TfsVersionControl: {
let repoUrl = repositoryUrl;
if (!repoUrl) {
if (collectionUrl && teamProject) {
repoUrl = '{0}{1}'.format(collectionUrl, teamProject);
}
}
return repoUrl ? '{0}/_versionControl/changeset/{1}'.format(repoUrl, commitId) : '';
}
default:
return '';
}
return '';
};

const getBuildUrl = (messageJSON: KuduLogMessage) => {
if (messageJSON.buildId) {
return messageJSON.buildProjectUrl
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ import DeploymentCenterGitHubConfiguredView from '../github-provider/DeploymentC
import DeploymentCenterContainerSettingsReadOnlyView from './DeploymentCenterContainerSettingsReadOnlyView';
import { SiteStateContext } from '../../../../SiteState';
import DeploymentCenterVstsBuildProvider from '../devops-provider/DeploymentCenterVstsBuildProvider';
import { MessageBar, MessageBarType, PrimaryButton, ProgressIndicator, Text } from '@fluentui/react';
import { Link, MessageBar, MessageBarType, PrimaryButton, ProgressIndicator } from '@fluentui/react';
import { AppOs, SiteContainer } from '../../../../models/site/site';
import DeploymentCenterData from '../DeploymentCenter.data';
import { PortalContext } from '../../../../PortalContext';
Expand All @@ -35,7 +35,10 @@ import { AcrDependency } from '../../../../utils/dependency/Dependency';
import DeploymentCenterVstsBuildConfiguredView from '../devops-provider/DeploymentCenterVstsBuildConfiguredView';
import { ArmObj } from '../../../../models/arm-obj';
import { style } from 'typestyle';
import { migrationBannerStyle } from '../DeploymentCenter.styles';
import { migrationBannerStyle, titleWithPaddingStyle } from '../DeploymentCenter.styles';
import { DeploymentCenterLinks } from '../../../../utils/FwLinks';
import { ThemeContext } from '../../../../ThemeContext';
import { customBannerLinkStyle } from '../../../../components/CustomBanner/CustomBanner.styles';

const DeploymentCenterContainerSettings: React.FC<DeploymentCenterFieldProps<DeploymentCenterContainerFormData>> = props => {
const { formProps, isDataRefreshing } = props;
Expand All @@ -48,6 +51,8 @@ const DeploymentCenterContainerSettings: React.FC<DeploymentCenterFieldProps<Dep
const [showVstsReadOnlyView, setShowVstsReadOnlyView] = useState(false);
const [showSourceSelectionOption, setShowSourceSelectionOption] = useState(false);
const [enableSidecarMigration, setEnableSidecarMigration] = useState(false);
const theme = useContext(ThemeContext);
const linkStyle = customBannerLinkStyle(theme);

// NOTE(michinoy): The serverUrl, image, username, and password are retrieved from one of three sources:
// acr, dockerHub, or privateRegistry.
Expand All @@ -72,7 +77,7 @@ const DeploymentCenterContainerSettings: React.FC<DeploymentCenterFieldProps<Dep
useEffect(() => {
let isSubscribed = true;

portalContext?.getBooleanFlight(ExperimentationConstants.FlightVariable.enableSidecarMigration).then(hasFlightEnabled => {
portalContext?.getBooleanFlight(ExperimentationConstants.FlightVariable.showDCReactView).then(hasFlightEnabled => {
if (isSubscribed) {
setEnableSidecarMigration(hasFlightEnabled);
}
Expand Down Expand Up @@ -397,14 +402,23 @@ const DeploymentCenterContainerSettings: React.FC<DeploymentCenterFieldProps<Dep
return (
<>
{showMigrationBanner && (
<>
<div className={titleWithPaddingStyle}>
<MessageBar messageBarType={MessageBarType.warning}>
<div className={migrationBannerStyle}>
<Text>{t('deploymentCenterUpdateToSidecarContainers')}</Text>
<PrimaryButton text={t('startUpdate')} onClick={openUpdateToSidecarPane} className={style({ maxWidth: '130px' })} />
<span>
<span tabIndex={0}>{t('deploymentCenterUpdateToSidecarContainers')}</span>
<Link className={linkStyle} href={DeploymentCenterLinks.sidecarsLink} target="_blank" aria-label={t('learnMore')}>
{t('learnMore')}
</Link>
</span>
<PrimaryButton
text={t('startUpdate')}
onClick={openUpdateToSidecarPane}
className={style({ maxWidth: '125px', maxHeight: '40px' })}
/>
</div>
</MessageBar>
</>
</div>
)}

{showSourceSelectionOption && <DeploymentCenterContainerSource formProps={formProps} />}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -733,10 +733,17 @@ export const getAuthSettings = (values: DeploymentCenterContainerFormData) => {
passwordSecret = '';
}
} else if (values.registrySource === ContainerRegistrySources.privateRegistry) {
authType = SiteContainerAuthType.UserCredentials;
userManagedIdentityClientId = '';
userName = values.privateRegistryUsername;
passwordSecret = values.privateRegistryPassword;
if (values.privateRegistryUsername && values.privateRegistryPassword) {
authType = SiteContainerAuthType.UserCredentials;
userManagedIdentityClientId = '';
userName = values.privateRegistryUsername;
passwordSecret = values.privateRegistryPassword;
} else {
authType = SiteContainerAuthType.Anonymous;
userManagedIdentityClientId = '';
userName = '';
passwordSecret = '';
}
}

return {
Expand Down
1 change: 1 addition & 0 deletions client-react/src/utils/FwLinks.ts
Original file line number Diff line number Diff line change
Expand Up @@ -86,4 +86,5 @@ export const DeploymentCenterLinks = {
roleAssignmentPrereqs: 'https://go.microsoft.com/fwlink/?linkid=2249489',
managedIdentityCreationPrereqs: 'https://go.microsoft.com/fwlink/?linkid=2253463',
oidcPermissionPrereqs: 'https://go.microsoft.com/fwlink/?linkid=2256502',
sidecarsLink: 'https://go.microsoft.com/fwlink/?linkid=2295005',
};
Original file line number Diff line number Diff line change
Expand Up @@ -4960,7 +4960,7 @@
<Str Cat="Text">
<Val><![CDATA[Default]]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA[Domyślne]]></Val>
<Val><![CDATA[Wartość domyślna]]></Val>
</Tgt>
</Str>
<Disp Icon="Str" />
Expand Down Expand Up @@ -7227,6 +7227,9 @@
<Item ItemId=";deploymentCenterSidecarForCodePrompt" ItemType="0;.resx" PsrId="211" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Interested in adding containers to run alongside your app? Click here to give it a try.]]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA[Chcesz dodać kontenery do uruchamiania razem z aplikacją? Kliknij tutaj, aby wypróbować tę opcję.]]></Val>
</Tgt>
</Str>
<Disp Icon="Str" />
</Item>
Expand Down Expand Up @@ -15561,6 +15564,9 @@
<Item ItemId=";minTlsCipherSuiteASEBannerInfo" ItemType="0;.resx" PsrId="211" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Minimum TLS cipher suite is not compatible with App Service Environment "FrontEndSSLCipherSuiteOrder" cluster setting. Ensure you have only configured one or the other.]]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA[Minimalny zestaw szyfrowania protokołu TLS jest niezgodny z ustawieniem klastra „FrontEndSSLCipherSuiteOrder” środowiska App Service Environment. Upewnij się, że skonfigurowano tylko jeden z nich.]]></Val>
</Tgt>
</Str>
<Disp Icon="Str" />
</Item>
Expand Down
106 changes: 1 addition & 105 deletions tools/pipelines/build/canary.yml
Original file line number Diff line number Diff line change
Expand Up @@ -61,84 +61,6 @@ jobs:
inputs:
ArtifactName: react-build

- job: AngularFull
pool:
vmImage: 'macOS-latest'

steps:
- task: NodeTool@0
inputs:
versionSpec: '14.x'
displayName: 'Install Node.js'

- script: |
cd client
npm ci
displayName: 'npm install'
- script: |
cd client
node_modules/.bin/ng build --progress false --output-path="public/ng-full"
displayName: 'ng build full'
- task: CopyFiles@2
displayName: 'Copy Files to: $(Build.ArtifactStagingDirectory)'
inputs:
SourceFolder: client/public
TargetFolder: '$(Build.ArtifactStagingDirectory)/public'

- task: PublishBuildArtifacts@1
displayName: 'Publish Artifact: angular-full'
inputs:
ArtifactName: angular-full

- job: AngularMin
pool:
vmImage: 'macOS-latest'

steps:
- task: NodeTool@0
inputs:
versionSpec: '14.x'
displayName: 'Install Node.js'

- script: |
npm install -g gulp-cli
displayName: 'install gulp'
- script: |
cd client
npm ci
displayName: 'npm install'
- script: |
cd client
node_modules/.bin/ng build --progress false --prod --environment=prod --output-path="../server/public/ng-min"
displayName: 'ng build full'
- script: |
cd server
npm ci
gulp replace-tokens-for-minimized-angular
displayName: 'Generate config file with angular files'
- task: CopyFiles@2
displayName: 'Copy Files to: $(Build.ArtifactStagingDirectory)'
inputs:
SourceFolder: server/public
TargetFolder: '$(Build.ArtifactStagingDirectory)/public'

- task: CopyFiles@2
displayName: 'Copy Assets to: $(Build.ArtifactStagingDirectory)'
inputs:
SourceFolder: client/src/assets
TargetFolder: '$(Build.ArtifactStagingDirectory)'

- task: PublishBuildArtifacts@1
displayName: 'Publish Artifact: angular-min'
inputs:
ArtifactName: angular-min

- job: Localization
pool:
vmImage: 'windows-2019'
Expand All @@ -161,8 +83,6 @@ jobs:
pool:
vmImage: 'macOS-latest'
dependsOn:
- AngularFull
- AngularMin
- ReactBuild
- Localization
steps:
Expand Down Expand Up @@ -193,36 +113,12 @@ jobs:
npm run build
displayName: 'Setup Environment Variables and Build Resources'
- task: DownloadBuildArtifacts@0
displayName: 'Download Angular Full Artifacts'
inputs:
artifactName: angular-full
downloadPath: $(System.DefaultWorkingDirectory)

- task: DownloadBuildArtifacts@0
displayName: 'Download Angular Min Artifacts'
inputs:
artifactName: angular-min
downloadPath: $(System.DefaultWorkingDirectory)

- task: DownloadBuildArtifacts@0
displayName: 'Download React Build Artifacts'
inputs:
artifactName: react-build
downloadPath: $(System.DefaultWorkingDirectory)

- task: CopyFiles@2
displayName: 'Copy Angular Full Files to: server/dist'
inputs:
SourceFolder: $(System.DefaultWorkingDirectory)/angular-full
TargetFolder: server/dist

- task: CopyFiles@2
displayName: 'Copy Angular Min Files to: server/dist'
inputs:
SourceFolder: $(System.DefaultWorkingDirectory)/angular-min
TargetFolder: server/dist

- task: CopyFiles@2
displayName: 'Copy React Build Files to: server/dist'
inputs:
Expand Down Expand Up @@ -294,7 +190,7 @@ jobs:
SourceFolder: $(Agent.BuildDirectory)/s/deployment
Contents: '**'
TargetFolder: $(Build.ArtifactStagingDirectory)

- task: PowerShell@2
displayName: 'Update BuildVer.txt' # For other versioning options check https://aka.ms/obpipelines/versioning
inputs:
Expand Down
Loading

0 comments on commit f0ac730

Please sign in to comment.