Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Tip referendum creation link #151

Merged
merged 2 commits into from
Apr 24, 2024
Merged

Tip referendum creation link #151

merged 2 commits into from
Apr 24, 2024

Conversation

rzadp
Copy link
Contributor

@rzadp rzadp commented Apr 23, 2024

Closes #150

If the user is not in the privileged GitHub team, the bot will try to produce a tip referendum creation link instead.

To achieve it, I extracted some functionality like preparing an extrinsic to separate functions.

If it works, it looks like this.

If there is an issue with generating the PolkadotJS-Apps link, it will fall back to a message without, like this.

@rzadp rzadp requested a review from a team as a code owner April 23, 2024 15:37
@rzadp rzadp changed the title Tip creation link Tip referendum creation link Apr 23, 2024
createReferendumLink = tipLink.extrinsicCreationLink;
} catch (e) {
bot.log.error("Failed to encode and create a link to tip referendum creation.");
bot.log.error(e.message);
Copy link
Contributor

Choose a reason for hiding this comment

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

if that's failed to create, then we have to return success:false and send this error to matrix and to user in PR?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I decided not to do it, because we have the fallback in the form of a link to Polkassembly docs, so this is not a critical issue I think.

Copy link
Contributor

Choose a reason for hiding this comment

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

ok, so if this happens 100% of the time or intermittently , and this link will never be created, do we need to know about it and chime in - like investigate why it's failed to create and followup?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

True. We still get the regular matrix notification that a tip is requested - I usually look at it anyway so I can see it that way that something is wrong.

@rzadp
Copy link
Contributor Author

rzadp commented Apr 24, 2024

Made sure it continues to work locally: paritytech-stg/playground#24 (comment)

@rzadp rzadp merged commit 2e2fda8 into master Apr 24, 2024
7 checks passed
@rzadp rzadp deleted the rzadp/creation-link branch April 24, 2024 11:48
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.

Propose an extrinsic-creation link for a tip-proposer that does not belong to the tip-approvers group
2 participants