Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

Where is the information about Git caches taken from?

Udo Hagemann _Decadis AG_ April 17, 2024

Hi,

hope there is an answer out there:

In Bamboo Data Center, you find in Bamboo administration / Repository settings / Manage caches / Git information about cache directory locations.

After migrating to a test instance and moving from local agents to remote agents, we still find cache directory locations, but they do not exist at all. Trying to delete them doesn't work, even if you create a fake directory on the server - in that case, the directory is removed, but the cache directory location still doesn't go away.

Where is this information retrieved from? I couldn't find anything in the database, not in the shared-home.

1 answer

1 accepted

2 votes
Answer accepted
Jyothi Charupalli
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
April 17, 2024

Hi @Udo Hagemann _Decadis AG_ ,

Welcome to Atlassian Community!

 Below is the Bamboo source code, how it figures out the list of cached dirs:


for (final ImmutablePlan plan : cachedPlanManager.getPlans(ImmutableChain.class)) {
customVariableContext.withVariableSubstitutor(customVariableContext.getVariableSubstitutorFactory().newSubstitutorForPlan(plan), () -> {
for (final GitRepository gitRepository : GitRepositoryFacade.GIT_REPOSITORIES_OF_PLAN.apply(plan)) {
final File cacheDir = gitRepository.getCacheDirectory();

plans.put(cacheDir, plan);
repositories.computeIfAbsent(cacheDir, key -> gitRepository.getSubstitutedAccessData());
}
});
}

The code goes through plans, checks what repositories they are connected to and computes the stuff you see on the cache page based on the configuration.

The cache dir (the hash part) is calculated based on repository data (URL + auth data IIRC).

In short: it looks like there must be a reference to the repository URL somewhere. Perhaps an override in PROJ > PLAN?

So, there must be a repository that resolves to that particular magic string(hash code) and where that URL shown in the description comes from. We also know that it's somehow referenced from PROJ -> PLAN.

We suggest you check if any of the repository configurations referring to the repository URL still exist.

Could you please try deleting the old repositories(Plan or Project or Global Linked Repos) linked to those git repositories caches and see if the entry disappears from the Bamboo Overview >Repository setting tab?

I hope this helps. Please let us know in case of any further queries.

Thanks and Regards,

Jyothi

**please don't forget to Accept the answer if your query was answered**

 

Udo Hagemann _Decadis AG_ April 18, 2024

Hi @Jyothi Charupalli ,

thank you so much, that gave me a much better understanding of what the page is meant for and where the data is retrieved!

Like Steffen Opel _Utoolity_ likes this

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events