How to make Git Commits Show in a Project's "Recent Activity" Feed


#21

@mydeveloperday If that is true and this is not possible then Phabricator is not in any way useful to us. This is easily the most basic piece of functionality we need. Even more basic than creating tasks.

I am confused because these people all think that it happens automatically that a commit is included in the project feed if the commit message has the project’s hashtag: https://secure.phabricator.com/T6973


#22

You don’t need a controller to do this. It is a simple Herald rule to add a project tag to a commit. Avivey mentioned that in his first response, but was met with a barrage of insults, which I guess is why no one other than you has continued to converse with this user who has professed several times that Phabricator does not meet his needs, and he is using something else, yet he keeps hanging around to make more disparaging comments, and baiting people by asking for Manual methods, then declaring the solution unworkable because its … manual.


#23

It is true I think we can get a better responses if we don’t come in, “guns a blazing”, its good to remember that most of those on this forum trying to help are doing so out of a community spirit, no one owns anyone a perfect system. (especially if they are not paying for it!).

However I’ve learnt through my day job, that behind every annoyed customer is often a good use case just fighting to get out…and every new customer who struggles to do something, shows a potential barrier to acceptance. This is a barrier I myself am trying to manage as I push the use of Phabricator inhouse into other software groups, so I’m interested to at least close those gaps in my own install.

Whilst I do get the herald case, isn’t that only the case when either the repository has a known project, or when the user remembers to add the hash tag at the point of commit.

Is there is a valid use case when someone retrospectively edits the commit by adding a project tag, would the herald rule pick that up?


#24

I think this should solve the use-case of “show all commits in repos that are in project foo”, for those that are willing to describe use-cases instead of demanding features:
https://secure.phabricator.com/diffusion/commit/query/PzQj9caCylA_/#R


I think there’s a way to do this using query-params too.


#25

@avivey I wrote the use case clearly multiple times. Your suggestion ignores that use case, as the use case has the commits show up in the user’s feed. It does not require the user to manually search. In my use case, the information comes to the user when something happens. In your case the user would already have to know that something is happening and then work to find it.

This is exactly the sort of response you always give. It shows you did not read the issue and it’s sarcastic. You must know that your suggestion does not help. But you would rather play this game than fix the product. Even when you have a user who will help test with you.

Now I know why Phabricator is so poor. Thank you. GitLab is working so I will continue to use it.


#26

You certainly are. @avivey has some other motivation. It’s not to help. It’s not to make a product that anyone can be proud of.

What everyone (including you) has missed is something I have said many times. According to multiple sources I linked to, this already works but does not work for me. Anyway I am happy with GitLab.


#27

Actually those were criticisms, and later on I insulted @avivey’c character because he worked so hard to play at being an ass. He had me going there - I thought he was trying to help and I spent hours following his suggestions only to find that he was intentionally leading me nowhere. But those were separate from explaining that the suggestions were not helpful for the actual Issue.

et he keeps hanging around

I’m replying to the messages I get.

asking for Manual methods

I have never asked for a “Manual method” but I was open to one. But no one provided a howto. Lots of terms were thrown around. But unless you want to explain what Herald is and how to use it for this case, it is just dumb to say things like “It is a simple Herald rule”.

Anyway GitLab is working great so I will continue to use it. I’ve already removed Phabricator.


#28

@avivey

Thank you for sticking with the question… :wink:

Also thanks for this suggestion regarding the “Tagged: TestProject”, But at least with my early tests this doesn’t seem quite right unless the repository itself is tagged with “TestProject” (not just the commit)

But you helped me find what I think is the solution

I don’t know why I didn’t see this before (duh!), but its a simple matter of doing a search with the “TestProject” in the Tag

And this discovers the commit which I manually added the TestProject to the commit.

So there are 3 things I see:

  1. Herald can be used to add a project to any commit (I assume any commit to a specific repo?)

  2. Users can manually add a tag to a commit via the “Edit Commit”

  3. But potentially the one missing part could be that commits with #hashtag in the message, do not automatically get added to the the commit as tags (unless Herald can see them and add them automatically)

Do you think it would be something worth looking at the CommitMessageParser and getting that to do the automatic adding of the tag to the commit? (perhaps the devs might think that is not the correct place to do that)

As always, many thanks for your help


#29

Hi,

It does not require the user to manually search. In my use case, the information comes to the user when something happens.

Queries can be added to dashboards, the same way the Activity feed does. I quickly put together an example dashboard displaying avivey’s query at https://secure.phabricator.com/dashboard/view/242/


#30

But potentially the one missing part could be that commits with #hashtag in the message, do not automatically get added to the the commit as tags (unless Herald can see them and add them automatically)

It might make sense to upstream, or maybe not, but the whole issue with “magic keywords in commit messages” is very hard to discover; And “users manually tag objects” is also a little fishy UX, but I guess it has it’s uses, especially when onboarding from another workflow.


#31
  1. Herald can be used to add a project to any commit (I assume any commit to a specific repo?)

Yes, this is working for me (and such tagged commits are showing up in the on the Project’s “Recent Activity” list)

Basically:

  1. Go to https://your-server/herald/ and press the Create Herald Rule button
  2. Create a Herald Rule for Commits, make it a Global rule
  3. Set your conditions, such as “Repository is X”
  4. Add an action to Add Projects with the project you want

If you have old commits you want to show up, you need to run bin/repository reparse --herald ... (add further options to select the repository, narrow date ranges etc - see bin/repository reparse --help for all the possibilities)

  1. Users can manually add a tag to a commit via the “Edit Commit”
  2. But potentially the one missing part could be that commits with #hashtag in the message, do not automatically get added to the the commit as tags (unless Herald can see them and add them automatically)

I don’t rely on developers tagging their commits in the commit message or web UI personally, so I don’t know if either of these options works for getting the commits to show up in the project feed. Certainly option 2 seems to be present, and option 3 used to work some time in the past based on old bug reports, but based on your experience, option 3 at least does not seem to be working any more. Probably Herald could be used to spot the tag in the commit message, but unless you have a requirement that the developers be able to choose whether to tag or not tag in their commit messages, I think a Herald rule that picks commits regardless of whether the developer remembered to tag them or not is probably a better solution.

From the OP’s past posts on the topic though, all this may still not meet the requirements, as it was mentioned that the end goal is for unprivileged users to be able to see that a commit has been made in the project feed. As this bypasses policy, I would expect it not to work, and I would not expect the Phabricator developers to consider it worthwhile to work on such a feature, as opening up possibilities for information leaking is not one of their goals. Probably the needs are best met outside of Phabricator by using the Conduit API or calling webhooks from Herald to make a separate feed page that publishes the commit log without needing to give access to the repository.


#32

I can totally see that Herald would work, I guess the use case I was thinking about what that I want to tag via the commit message to indicate the area or topic of the change I’m doing (perhaps like I would do with a task)

lets assume we have a repo (rPHABRICATOR will do…)

now I make a commit which touches say #differential and #herald

now I don’t want all commits of rPHABRICATOR to be tagged with those projects (which is what I think Herald would do), only those commits that touch those projects (and of course the correct way to do this is using Tasks)

but ideally I’d like to just put that #hashtag on the commit message and have the commit message parser marry the the commit and project together just like it would if I added the tag by hand via “Edit Commit”

but wouldn’t it be nice to go into the #differential project and be able to pull out all commits that were tagged with #differential (without having to trawl through the feed of other events), and shouldn’t commits that have tasks with projects potentially also be somehow connected to the list of commits associated with a certain project.

This is kind of what I do, I watch what @epriestley commits, so as to learn how to do stuff simply by visiting his recent commits,

https://secure.phabricator.com/people/commits/10/

I find it keeps me in touch with what is actually getting committed so I know what to expect if I do a pull, but mainly so I learn about diverse sections of the code and see how he introduces new features.

For example, imagine your trying to learn how to make a custom remarkup rule, wouldn’t it be great to visit a “RemarkUp” project and instantly just look at the historical commits in order to see examples of recent changes in that area

So I guess (at least from the UI perspective) I don’t see the difference between a user and a project

This is why I started trying to write a PhabricatorProjectCommitsController, I think if I can work out how that Browse Commits form get transformed into php code then it should be possible to present a projects commits in the same way as the users commits are presented.


#33

In practice, I don’t think users will end up correctly tagging their commits all the time, or even a significant part of the time…
A more automated solution is to use Herald rules about changed file names/content, and tag based on that (or search based on that - maybe expose git log -G in the web ui).


#34

In practice, I don’t think users will end up correctly tagging their commits all the time, or even a significant part of the time

Devs might and devs are uploading to github. But you are correct that this would be a bad solution. The good solution would be the feature request from the post in my original question: https://secure.phabricator.com/T6973