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

feat: add commit hash to comments #675

Merged
merged 71 commits into from
Jul 6, 2023
Merged

Conversation

PhantomCracker
Copy link
Contributor

Resolves #663

@0x4007
Copy link
Member

0x4007 commented Jun 8, 2023

Can you open a pull request on your fork and link it here to prove that it works? Otherwise can you post any other proof that it works?

@PhantomCracker
Copy link
Contributor Author

Can you open a pull request on your fork and link it here to prove that it works? Otherwise can you post any other proof that it works?

Please check this PR: PhantomCracker#7

@0x4007
Copy link
Member

0x4007 commented Jun 18, 2023

I don't see the commit hashes there. What are you showing with your linked pull request? I'm not asking to see the code. I'm asking to see proof that it works according to the spec.

@ubiquibot
Copy link

ubiquibot bot commented Jun 18, 2023

Deployment: Sun Jun 18 2023 13:47:10 (UTC)
Deployment: Sun Jun 18 2023 14:31:06 (UTC)
Deployment: Sun Jun 18 2023 14:42:33 (UTC)
Deployment: Mon Jun 19 2023 10:51:25 (UTC)
Deployment: Mon Jun 19 2023 10:56:01 (UTC)
Deployment: Mon Jun 19 2023 10:57:03 (UTC)
Deployment: Mon Jun 19 2023 11:01:50 (UTC)
Deployment: Mon Jun 19 2023 11:09:44 (UTC)
Deployment: Mon Jun 19 2023 11:12:29 (UTC)
Deployment: Mon Jun 19 2023 11:16:06 (UTC)
Deployment: Mon Jun 19 2023 11:22:47 (UTC)
Deployment: Mon Jun 19 2023 11:37:08 (UTC)
Deployment: Mon Jun 19 2023 11:43:36 (UTC)
Deployment: Mon Jun 19 2023 12:54:54 (UTC)
Deployment: Mon Jun 19 2023 12:57:49 (UTC)
Deployment: Mon Jun 19 2023 12:58:03 (UTC)
Deployment: Mon Jun 19 2023 13:00:13 (UTC)
Deployment: Mon Jun 19 2023 13:01:43 (UTC)
Deployment: Mon Jun 19 2023 13:04:16 (UTC)
Deployment: Mon Jun 19 2023 13:14:31 (UTC)
Deployment: Mon Jun 19 2023 13:23:31 (UTC)
Deployment: Mon Jun 19 2023 13:26:14 (UTC)
Deployment: Mon Jun 19 2023 13:33:10 (UTC)
Deployment: Mon Jun 19 2023 13:39:42 (UTC)
Deployment: Mon Jun 19 2023 13:40:21 (UTC)
Deployment: Mon Jun 19 2023 16:26:38 (UTC)
Deployment: Mon Jun 19 2023 16:37:03 (UTC)
Deployment: Mon Jun 19 2023 17:32:00 (UTC)
Deployment: Mon Jun 19 2023 17:35:33 (UTC)
Deployment: Mon Jun 19 2023 17:43:20 (UTC)
Deployment: Mon Jun 19 2023 17:55:01 (UTC)
Deployment: Mon Jun 19 2023 18:03:48 (UTC)
Deployment: Mon Jun 19 2023 18:04:25 (UTC)
Deployment: Tue Jul 04 2023 08:44:30 (UTC)
Deployment: Tue Jul 04 2023 08:58:14 (UTC)
Deployment: Tue Jul 04 2023 14:38:56 (UTC)
Deployment: Tue Jul 04 2023 14:40:06 (UTC)

@PhantomCracker
Copy link
Contributor Author

@pavlovcik recheck the PR please; here is also the proof of testing:
Screenshot 2023-06-18 at 18 02 06

@0x4007
Copy link
Member

0x4007 commented Jun 18, 2023

I don't see any comments posted by the bot with the commit hashes on your fork.

@PhantomCracker
Copy link
Contributor Author

Please check the following GH action results: https://github.com/PhantomCracker/ubiquity-dollar/actions/runs/5445801433/jobs/9905580034
Here is also a screenshot:
Screenshot 2023-07-03 at 17 46 14

@PhantomCracker PhantomCracker marked this pull request as ready for review July 3, 2023 14:48
@rndquu
Copy link
Member

rndquu commented Jul 4, 2023

@PhantomCracker pls check this PR rndquu#20

It prints [Deployment: Tue Jul 04 2023 08:22:14 (UTC) | Commit: 2c143d6c0018b081b8b8c865e6d9ff0647763c4a](https://a630927c.ubiquity-dollar-1cd.pages.dev/) but the latest commit hash is a82e8ca6894d37b50a3a336352362afb49e15101. So they are expected to match.

@rndquu rndquu marked this pull request as draft July 4, 2023 08:28
@PhantomCracker
Copy link
Contributor Author

@PhantomCracker pls check this PR rndquu#20

It prints [Deployment: Tue Jul 04 2023 08:22:14 (UTC) | Commit: 2c143d6c0018b081b8b8c865e6d9ff0647763c4a](https://a630927c.ubiquity-dollar-1cd.pages.dev/) but the latest commit hash is a82e8ca6894d37b50a3a336352362afb49e15101. So they are expected to match.

Thank you for feedback, work in progress!

@PhantomCracker
Copy link
Contributor Author

Hm... @rndquu i come back with different tests:
PhantomCracker@dcd6a09#comments
and PhantomCracker@6d39638#comments

I have also tried to create a new PR to test this: PhantomCracker#8
As you can see, the SHA is: a3b4d07 which is the same as in this action: https://github.com/PhantomCracker/ubiquity-dollar/actions/runs/5453519281/jobs/9922468500
But the last commit have the following SHA: 975a329 which corresponds to this action: https://github.com/PhantomCracker/ubiquity-dollar/actions/runs/5453525015/jobs/9922481199
The difference between these two is that on the first action, we display the SHA for the PR, while on the second we display the SHA for the commit PhantomCracker@975a329#comments

Is this the expected functionality?

@rndquu
Copy link
Member

rndquu commented Jul 4, 2023

Hm... @rndquu i come back with different tests: PhantomCracker@dcd6a09#comments and PhantomCracker@6d39638#comments

I have also tried to create a new PR to test this: PhantomCracker#8 As you can see, the SHA is: a3b4d07 which is the same as in this action: https://github.com/PhantomCracker/ubiquity-dollar/actions/runs/5453519281/jobs/9922468500 But the last commit have the following SHA: 975a329 which corresponds to this action: https://github.com/PhantomCracker/ubiquity-dollar/actions/runs/5453525015/jobs/9922481199 The difference between these two is that on the first action, we display the SHA for the PR, while on the second we display the SHA for the commit PhantomCracker@975a329#comments

Is this the expected functionality?

pls merge the latest development branch and try again, commit hashes should be the same now

@PhantomCracker PhantomCracker marked this pull request as ready for review July 4, 2023 14:28
@PhantomCracker
Copy link
Contributor Author

Indeed it works! 👍 🥳
Proof of testing: PhantomCracker#9

@rndquu rndquu requested a review from 0x4007 July 4, 2023 15:14
@@ -13,7 +13,7 @@ module.exports = async ({ github, context, fs }) => {
const botCommentsArray = [];

if (uniqueDeployUrl) {
defaultBody = `[Deployment: ${new Date()}](${uniqueDeployUrl})`;
defaultBody = `[Deployment: ${new Date()} | Commit: ${commitSha}](${uniqueDeployUrl})`;
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
defaultBody = `[Deployment: ${new Date()} | Commit: ${commitSha}](${uniqueDeployUrl})`;
defaultBody = `- [${commitSha}](${uniqueDeployUrl})`;

Can you also calculate the seven letter commit SHA like how GitHub displays it? I'm unsure if they slice the end or if they calculate it differently but it should match what shows in the UI (which if I recall is seven characters- sorry I'm on my phone GitHub client now it's not easy for me to check)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Sure, I will update it

@PhantomCracker PhantomCracker requested a review from 0x4007 July 6, 2023 08:40
@0x4007
Copy link
Member

0x4007 commented Jul 6, 2023

I hope you verified that the way you're deriving the seven character SHA matches what GitHub displays or ill have to revert this.

@0x4007 0x4007 merged commit f6e2d67 into ubiquity:development Jul 6, 2023
@PhantomCracker
Copy link
Contributor Author

PhantomCracker commented Jul 7, 2023

I hope you verified that the way you're deriving the seven character SHA matches what GitHub displays or ill have to revert this.

For "dcd6a09fd116d210b173ca8569b94c8a1ab40a83" we will display dcd6a09.
Please let me know if something is wrong and I will fix it 😄

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.

Bot Deploys Comment Should Include Commit Hashes
3 participants