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

Question: What is "main" branch in context of Azure Pipelines Caching? #17552

Closed
MTomBosch opened this issue Jan 3, 2023 · 9 comments
Closed

Comments

@MTomBosch
Copy link

Required Information

Entering this information will route you directly to the right team and expedite traction.

Type: QUestion

Enter Task Name: Cache

Environment

Azure DevOps SaaS
Private build agents

Issue Description

What is the "main" branch that is listed in the tables here: https://learn.microsoft.com/en-us/azure/devops/pipelines/release/caching?view=azure-devops#cache-isolation-and-security?

Is it literally the "main" branch, or is it the default branch of the Git repository or even something else that can be configured?

Thank you

@kirill-ivlev
Copy link
Contributor

Hi @johnterickson!
The main branch in this context is the branch which is the default master branch (might be main/master or any other).

@kirill-ivlev kirill-ivlev self-assigned this Jan 4, 2023
@johnterickson
Copy link
Contributor

johnterickson commented Jan 4, 2023

"main branch" refers to the service checking both cache scopes refs/heads/master and refs/heads/main. It is not configurable.

@MTomBosch
Copy link
Author

MTomBosch commented Jan 5, 2023

Hi @johnterickson! The main branch in this context is the branch which is the default master branch (might be main/master or any other).

@kirill-ivlev What do you mean by default master branch in Azure DevOps repos? Is it the branch that can be configured in Azure DevOps Repos as "default" branch for a repository? Looking at the default value for the default branch it is "main" making me believe that when I change this branch to something else it will be used as the "main" branch in the cache context. Can someone from dev verify this guess of mine?

@MTomBosch
Copy link
Author

PS. Adding this information to the official docs would help other users that have the same question related to caching.

@johnterickson
Copy link
Contributor

Pipeline Caching does not use "default": master and main are hard-coded.

@MTomBosch
Copy link
Author

Thanks for the clarification.

@jzabroski
Copy link

@johnterickson I recently changed my repository github.com/fluentmigrator/fluentmigrator to use "main" instead of "master". In Azure Pipelines, I am getting the following error when I click Run Pipeline from the web UI:

Encountered error(s) while parsing pipeline YAML:
Could not get the latest source version for repository fluentmigrator/fluentmigrator hosted on https://github.com/ using ref refs/heads/master. GitHub reported the error, "No commit found for SHA: refs/heads/master"

My pipeline file is https://github.com/fluentmigrator/fluentmigrator/blob/main/azure-pipelines.yml

When I click Validate on this pipeline, it returns OK.

The triggers are configured as:

trigger:
  branches:
    include:
    - release/*
    - main
  tags:
    include:
    - v1.*
    - v2.*
    - v3.*
    - v4.*
    - v5.*

pr: none

What's strange is Pull Requests in a separate yaml file are working correctly: https://github.com/fluentmigrator/fluentmigrator/blob/main/azure-pipelines-pullrequests.yml

I am honestly stumped as to what went wrong. It seems as though Azure Pipelines has cached my old default branch as master, hence why I am adding a comment here.

@johnterickson
Copy link
Contributor

@jzabroski That sounds unrelated to Pipeline Caching - you should open a new issue.

@jzabroski
Copy link

jzabroski commented Feb 8, 2024

@johnterickson Sorry for awakening the dead :). I re-posted it in azure-pipelines-yaml - a bit confusing to know if that is the right repo or if azure-pipelines-tasks is the right repo, or if azure-pipelines-agent is the right repo...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants