On Mon, Jul 24, 2023 at 10:44 AM Chad Wilson <[email protected]> wrote:
> On Mon, Jul 24, 2023 at 8:44 PM Joshua Franta <[email protected]> wrote: > >> >> chad thanks for your answer. >> >> i think the main source of confusion is that I thought parameters could >> only be referred to in scripts! >> I didn't know you could refer to them inside of other configuration >> properties! >> Is this documented? Regardless that's super useful, there's probably >> some other things that can be cleaned up knowing that. >> > > > https://docs.gocd.org/current/configuration/admin_use_parameters_in_configuration.html#rules-around-usage-of-parameters > thanks and i even checked the docs for first version of gocd we used, feature was still there. just missed it. > > If it's left as empty for ANY-aka-SLOW resources, will gocd intepret this >> as a blank resource requirement and fail? >> Or will it ignore blank resources? >> > > I'm not sure - perhaps just try it empirically? It could either fail or > see it as blank i.e "no resource requirement" - I don't think there's a > strong case for either behaviour being more correct. > > -Chad > if somebody does it accidentally i will try to report back. looking at the source, this bit here seems to suggest that 'NULL' resources ARE allowed. a superficial glance suggests that 'empty' resources are ignored and GO_AGENT_RESOURCES isn't set when this is the case: ----- // via: https://github.com/gocd/gocd/blob/f5859f59171fb95e1a40bf5911e4f6d3f2de43e9/server/src/main/java/com/thoughtworks/go/server/service/BuildAssignmentService.java#L309 if (CollectionUtils.isNotEmpty(agent.getResourceConfigs())) { // Users relying on this env. var. can test for its existence rather than checking for an empty string environmentVariableContext.setProperty(GO_AGENT_RESOURCES, agent.getResourceConfigs().getCommaSeparatedResourceNames(), false); } //... BuildAssignment buildAssignment = BuildAssignment.create(job, pipeline.getBuildCause(), builders, pipeline.defaultWorkingFolder(), environmentVariableContext, requiredArtifactStores); ----- chad thx again for your close reading of my answers. not sure i would've discovered the misunderstanding so quickly otherwise! really appreciate all the help from everybody. -j > -- You received this message because you are subscribed to the Google Groups "go-cd" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To view this discussion on the web visit https://groups.google.com/d/msgid/go-cd/CABr%2BOtqB88CF815S8QEu1PAMOrDTUQFbU_f0-QzPR%2B6tHYqrdw%40mail.gmail.com.
