YannickRe / azuredevops-buildagents

Generate self-hosted build agents for Azure DevOps, just like Microsoft does.
MIT License
153 stars 90 forks source link

Corrected hotfix for setting tag "ExcludeMdeAutoProvisioning": "True" #74

Closed erik-de-bont closed 10 months ago

erik-de-bont commented 10 months ago

Solution for issue https://github.com/YannickRe/azuredevops-buildagents/issues/73

Due to syntax changes in de the windows template files from the actions/runnerimages, the hotfix of setting the tag "ExcludeMdeAutoProvisioning": "True" was not set anymore. This causes the sysprep of the buildimage to fail if Microsoft Defender is used in Azure.. The new code fixes this issues.

YannickRe commented 10 months ago

Hi @erik-de-bont ! Thanks for the work, but can you please see if you can limit the PR to the commits essential for it? I'm currently seeing also 30 commit from 2 months ago, and that doesn't seem right.

Thank you!

erik-de-bont commented 10 months ago

Hi @YannickRe ! Maybe I using Github wrong, but I have to commit my (test) changes to my repository to test if the pipeline is working in stead of testing it locally. If you recommend any improvement on how to do this let me know.

YannickRe commented 10 months ago

I took a different approach cherry picking your commits and merging them back (you still have commit credit 😉): https://github.com/YannickRe/azuredevops-buildagents/commit/4c5d3136ed2edd114642928f913d118543bb8867

I suggest you take the following approach for future PR's.

Before starting the PR

# assuming you are in the folder of your locally cloned fork....
git checkout main

# if you have no upstream yet run the command below. This has to be done only once
git remote add upstream https://github.com/YannickRe/azuredevops-buildagents.git

# assuming you have a remote named `upstream` pointing to the YannickRe/azuredevops-buildagents repo
git fetch upstream

# update your local main branch to be a mirror of what's in the main repo
git pull --rebase upstream main

At this point, your main branch is now exactly like my repo without any additional merging commits.

Working the PR

It's easier to work on PR's in a separate branch

# Replace new-pr with a nice name for the branch
git checkout new-pr

Make all your changes in this branch, and test it out, and make the commits.

Making the PR

# assuming you are in the folder of your locally cloned fork....
git checkout main

# assuming you have a remote named `upstream` pointing to the YannickRe/azuredevops-buildagents repo
git fetch upstream

# update your local main branch to be a mirror of what's in the main repo
git pull --rebase upstream main

# switch to your branch where you are working, say "new-pr"
git checkout new-pr

# update your branch to update its fork point to the current tip of main & put your changes on top of it
git rebase main

This will go back to your main branch, resyncs it with my main branch (so you have the latest changes), rebase your new-pr branch onto main, so your new-pr branch also has all the new changes. Then you can push the new-pr branch to your forked repo, and start the PR from that branch (instead of from your main).

erik-de-bont commented 10 months ago

@YannickRe Thank I will try that in the future.