Skip to content
This repository was archived by the owner on Aug 12, 2020. It is now read-only.

Conversation

@josmo
Copy link
Contributor

@josmo josmo commented May 6, 2017

@bradrydzewski Here's a working version of
user_agent: [ server, local ]
selection for where the step should run. This should allow to select both local and server or either or. My implementation feels a little hackish so hopefully but you might have an idea on how it would better work.

Copy link
Contributor

@bradrydzewski bradrydzewski left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

awesome! just some minor suggestions, but great work :)

Status Constraint
Matrix ConstraintMap
Local types.BoolTrue
User_agent Constraint
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

you can do this:

UserAgent Constraint `yaml:"user_agent"`

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ah, didn't know. but done :)

// Match returns true if all constraints match the given input. If a single
// constraint fails a false value is returned.
func (c *Constraints) Match(metadata frontend.Metadata) bool {
func (c *Constraints) Match(metadata frontend.Metadata, local bool) bool {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@josmo
Copy link
Contributor Author

josmo commented May 6, 2017

@bradrydzewski let me know if that works for you. I'm not exactly sure where to set the value for the UserAgent in the metadata but whats there now seems to work :)

@bradrydzewski
Copy link
Contributor

thanks! let's get some more input on this, but so far looks great

Copy link
Contributor

@tonglil tonglil left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

local and server user-agents can be a little confusing. What sets the container's constraints (to ensure that by default they require either server or local)?

Status Constraint
Matrix ConstraintMap
Local types.BoolTrue
UserAgent Constraint `yaml:"user_agent"`
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

gofmt indent

@bradrydzewski
Copy link
Contributor

What sets the container's constraints (to ensure that by default they require either server or local)?

The client and server would each have a different user-agent string that it would pass to the build for evaluation at runtime. If the yaml does not define any user-agent conditions, it would run for all user agents.

Definitely open to other ideas / less confusing names

@josmo
Copy link
Contributor Author

josmo commented May 15, 2017

Would remote/local be better then server/local? Although remote is already used for the source of the repos. :/

@tonglil
Copy link
Contributor

tonglil commented May 16, 2017

What about master/agent? That is the meaning that I am getting by reading local (master) and server (Drone agents).

@josmo
Copy link
Contributor Author

josmo commented May 16, 2017

Master agent make me more think of master being the drone server and agent being the build agent. But I could see local/agent as something that may make sense?

@josmo
Copy link
Contributor Author

josmo commented Aug 17, 2017

@bradrydzewski was just going to check back in on this if we wanted to move forward with it or something else :)

@bradrydzewski
Copy link
Contributor

actually, the plan is to remove when: { local: true } and replace with a different solution. Basically would like to enable or disable a list of specific steps.

for example:

drone exec --include=build,test
drone exec --exclude=deploy,notify

This could be provided with the following compiler options:

WithIncludes("build, "test")
WithExcludes("deploy", "notify")

This would add or remove these steps at runtime.

@josmo
Copy link
Contributor Author

josmo commented Aug 17, 2017

Ah, I like that better, less clutter in the .drone.yml but how does it handle something that should only run locally but not on the build agent?

@bradrydzewski
Copy link
Contributor

bradrydzewski commented Aug 22, 2017

Sorry for sitting on this for so long, but sometimes sitting on things gives me time to gather my thoughts and talk with other users about their use cases. After careful consideration I think we need both user_agent: [ cli, server ] and we need --include and --exclude. So I will get this merged soon.

Sorry again for the delay 😄

# Conflicts:
#	pipeline/frontend/yaml/constraint.go
#	pipeline/frontend/yaml/constraint_test.go
@josmo
Copy link
Contributor Author

josmo commented Apr 27, 2018

@bradrydzewski Should I try to keep this PR up to date or do you have other plans for it :)

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants