Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 1 addition & 11 deletions agent/command/git.go
Original file line number Diff line number Diff line change
Expand Up @@ -610,10 +610,6 @@ func (c *gitFetchProject) fetch(ctx context.Context,

// For every module, expand the module prefix.
for _, moduleName := range conf.BuildVariant.Modules {
expanded, err := conf.NewExpansions.ExpandString(moduleName)
if err == nil {
moduleName = expanded
}
module, err := conf.Project.GetModuleByName(moduleName)
if err != nil {
return errors.Wrapf(err, "getting module '%s'", moduleName)
Expand All @@ -628,13 +624,7 @@ func (c *gitFetchProject) fetch(ctx context.Context,
g.SetLimit(10)

// Clone the project's modules in goroutines.
for _, name := range conf.BuildVariant.Modules {
// TODO (DEVPROD-3611): remove capturing the loop variable and use the loop variable directly.
moduleName := name
expanded, err := conf.NewExpansions.ExpandString(moduleName)
if err == nil {
moduleName = expanded
}
for _, moduleName := range conf.BuildVariant.Modules {
g.Go(func() error {
if err := gCtx.Err(); err != nil {
return nil
Expand Down
3 changes: 1 addition & 2 deletions agent/command/git_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -839,9 +839,8 @@ func (s *GitGetProjectSuite) TestCorrectModuleRevisionManifestWithExpansion() {
conf := s.taskConfig2
logger, err := s.comm.GetLoggerProducer(s.ctx, &conf.Task, nil)
s.Require().NoError(err)
conf.BuildVariant.Modules = []string{"${sample_expansion_name}"}
conf.BuildVariant.Modules = []string{"sample"}
conf.Expansions.Put(moduleRevExpansionName("sample"), correctHash)
conf.Expansions.Put("sample_expansion_name", "sample")

for _, task := range conf.Project.Tasks {
s.NotEmpty(task.Commands)
Expand Down
12 changes: 12 additions & 0 deletions agent/internal/task_config.go
Original file line number Diff line number Diff line change
Expand Up @@ -265,6 +265,18 @@ func NewTaskConfig(opts TaskConfigOptions) (*TaskConfig, error) {
taskConfig.PatchOrVersionDescription = opts.Version.Message
}

if opts.ExpansionsAndVars != nil && opts.ExpansionsAndVars.Expansions != nil {
expandedModules := make([]string, 0, len(taskConfig.BuildVariant.Modules))
for _, moduleName := range taskConfig.BuildVariant.Modules {
expanded, err := opts.ExpansionsAndVars.Expansions.ExpandString(moduleName)
if err != nil {
return nil, errors.Wrapf(err, "failed to expand module '%s'", moduleName)
}
expandedModules = append(expandedModules, expanded)
}
taskConfig.BuildVariant.Modules = expandedModules
}

return taskConfig, nil
}

Expand Down
2 changes: 1 addition & 1 deletion config.go
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ var (

// Agent version to control agent rollover. The format is the calendar date
// (YYYY-MM-DD).
AgentVersion = "2026-02-10a"
AgentVersion = "2026-02-11"
)

const (
Expand Down
Loading