Skip to content

feat: support --ignore flag in can-i-merge command#174

Closed
stan-is-hate wants to merge 1 commit into
pact-foundation:masterfrom
stan-is-hate:can-i-merge-ignore
Closed

feat: support --ignore flag in can-i-merge command#174
stan-is-hate wants to merge 1 commit into
pact-foundation:masterfrom
stan-is-hate:can-i-merge-ignore

Conversation

@stan-is-hate
Copy link
Copy Markdown
Contributor

This should bring it up-to-date with can-i-deploy.
Tested by unit test and also by building it and running locally against dockerized broker.

Comment thread README.md
-h, [--branch=BRANCH]
# Repository branch of the consumer version
-r, [--auto-detect-version-properties], [--no-auto-detect-version-properties]
-r, [--auto-detect-version-properties], [--no-auto-detect-version-properties], [--skip-auto-detect-version-properties]
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

What's going on with all of these --skip-.. variants?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

I just ran a command from README to re-generate docs, so I guess someone added these flags but never re-generated the docs

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Thanks Stan. @YOU54F @pahnin any ideas as to why these --skip things are appearing? It's not entirely clear how they're different to the --no-... options.

Copy link
Copy Markdown
Member

@YOU54F YOU54F Oct 23, 2024

Choose a reason for hiding this comment

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

Looks like it came from this commit, (documenting of the option), which was released in thor 1.3.1. Downgrading thor to 1.3.0 and running ruby script/update-cli-usage-in-readme.rb will generate the readme without the --skip* opts

rails/thor@686bcd5

The option itself has been there since 2009 - commit

effectively --no-foo is the same as --skip-foo

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

You can rebase against master now as I've performed that readme update in a separate PR

#176

Comment thread lib/pact_broker/client/cli/matrix_commands.rb
ENV.fetch("PACT_BROKER_CAN_I_DEPLOY_IGNORE", "").split(",").collect(&:strip).collect{ |i| { pacticipant: i } }
end
def ignore_merge_selectors_from_environment_variable
ENV.fetch("PACT_BROKER_CAN_I_MERGE_IGNORE", "").split(",").collect(&:strip).collect{ |i| { pacticipant: i } }
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Right, yes can't specify versions here :)

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

I just copied the behavior of can-i-deploy ignore flag/var :)

Comment thread spec/integration/can_i_merge_spec.rb
@YOU54F
Copy link
Copy Markdown
Member

YOU54F commented Oct 23, 2024

Looks good to me, I've updated the proposed test and added a new one to test the ignore logic, whereby a broker result contains 2 indiv verification results for 2 consumers, 1 failing, 1 passing.

see #177 (including a rebase against master to avoid the additional readme update noise)

In one case, the broker returns an ignored verification, the matrix lists it, and exits successfully.

In the other case, the broker returns an undeployable verification, and computer says now

@stan-is-hate
Copy link
Copy Markdown
Contributor Author

Thanks @YOU54F ! With your PR in flight, should we close this one?

@YOU54F
Copy link
Copy Markdown
Member

YOU54F commented Oct 24, 2024

merged as part of #177, ty

@YOU54F YOU54F closed this Oct 24, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants