Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

The common scripts of PR git diff changes. #2824

Merged
4 commits merged into from
Mar 3, 2022
Merged

Conversation

sima-zhu
Copy link
Contributor

@sima-zhu sima-zhu commented Feb 25, 2022

Have a common script for git diff changes.
Test proposal:
PR triggered(Compliance credscan): Azure/azure-sdk-for-js#20643
Manually triggered(Build print diff): https://dev.azure.com/azure-sdk/internal/_build/results?buildId=1407323&view=results
Test on Add, Update, Delete, Rename cases(Compliance credscan): Azure/azure-sdk-for-js#20643
Test on sparse-checkout cases(Build print diff): Azure/azure-sdk-for-java#27335

image

The git diff changes will add the file outside of the sparse checkout

@azure-sdk
Copy link
Collaborator

The following pipelines have been queued for testing:
java - template
java - template - tests
js - template
net - template
net - template - tests
python - template
python - template - tests
You can sign off on the approval gate to test the release stage of each pipeline.
See eng/common workflow

@azure-sdk
Copy link
Collaborator

The following pipelines have been queued for testing:
java - template
java - template - tests
js - template
net - template
net - template - tests
python - template
python - template - tests
You can sign off on the approval gate to test the release stage of each pipeline.
See eng/common workflow

@sima-zhu sima-zhu changed the title [Do not review, for test]run a test The common scripts of PR git diff changes. Mar 2, 2022
@sima-zhu sima-zhu marked this pull request as ready for review March 2, 2022 21:27
[string] $SourceCommittish = ${env:BUILD_SOURCEVERSION},
[string] $TargetCommittish = ("origin/${env:SYSTEM_PULLREQUEST_TARGETBRANCH}" -replace "refs/heads/")
)
# Git PR diff: https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/proposing-changes-to-your-work-with-pull-requests/about-comparing-branches-in-pull-requests#three-dot-and-two-dot-git-diff-comparisons
Copy link
Member

Choose a reason for hiding this comment

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

I imagine our link checker won't like the /en/ segment in there

@azure-sdk
Copy link
Collaborator

The following pipelines have been queued for testing:
java - template
java - template - tests
js - template
net - template
net - template - tests
python - template
python - template - tests
You can sign off on the approval gate to test the release stage of each pipeline.
See eng/common workflow

@azure-sdk
Copy link
Collaborator

The following pipelines have been queued for testing:
java - template
java - template - tests
js - template
net - template
net - template - tests
python - template
python - template - tests
You can sign off on the approval gate to test the release stage of each pipeline.
See eng/common workflow

@azure-sdk
Copy link
Collaborator

The following pipelines have been queued for testing:
java - template
java - template - tests
js - template
net - template
net - template - tests
python - template
python - template - tests
You can sign off on the approval gate to test the release stage of each pipeline.
See eng/common workflow

Copy link
Member

@chidozieononiwu chidozieononiwu left a comment

Choose a reason for hiding this comment

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

Works for the eng/common workflow enforcer case

Comment on lines 23 to 28
if(!$changedFiles) {
Write-Host "No changed files in git diff between $TargetCommittish and $SourceCommittish"
}
foreach ($file in $changedFiles) {
Write-Host "The diff file is: $file"
}
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
if(!$changedFiles) {
Write-Host "No changed files in git diff between $TargetCommittish and $SourceCommittish"
}
foreach ($file in $changedFiles) {
Write-Host "The diff file is: $file"
}
if(!$changedFiles) {
Write-Host "No changed files in git diff between $TargetCommittish and $SourceCommittish"
}
foreach ($file in $changedFiles) {
Write-Host "The diff file is: $file"
}

@kushagraThapar
Copy link
Member

@sima-zhu / @benbp - seems like the above azure-sdk-tools - sync - eng-common CI is stuck / or waiting for some approval.
Can we please merge this PR soon, so that other Cosmos CI PRs can be merged, this is currently blocking our Cosmos CI, and all development / release process. Thanks!

@ghost
Copy link

ghost commented Mar 3, 2022

Hello @azure-sdk!

Because this pull request has the auto-merge label, I will be glad to assist with helping to merge this pull request once all check-in policies pass.

p.s. you can customize the way I help with merging this pull request, such as holding this pull request until a specific person approves. Simply @mention me (@msftbot) and give me an instruction to get started! Learn more here.

@ghost ghost merged commit 7bce954 into Azure:main Mar 3, 2022
@sima-zhu sima-zhu deleted the git_diff branch March 3, 2022 18:44
Comment on lines +32 to +35
Write-Host "Here are the diff files:"
foreach ($file in $changedFiles) {
Write-Host " $file"
}
Copy link
Member

Choose a reason for hiding this comment

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

We should put this block inside the else from above so we don't end up with extra logging in the empty case.

param (
[string] $SourceCommittish = "${env:BUILD_SOURCEVERSION}",
[string] $TargetCommittish = ("origin/${env:SYSTEM_PULLREQUEST_TARGETBRANCH}" -replace "refs/heads/")
)
Copy link
Member

Choose a reason for hiding this comment

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

We probably also need an optional parameter to pass in a path filter. (i.e. for things like eng/common).

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes, a new code changes proposed in PR
#2861

This pull request was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants