Link to issue page from within Phabricator - issue-tracking

We've been using Phabricator for post-commit code reviews (aka Audits) for some months now. When doing a commit we also attach an issue number ("Issue: XXXX").
The issue tracker url for this issue is:
site.com/issue/XXXX
I'm wondering if there's any way we could configure Phabricator to replace this text with a hyperlink to its corresponding URL when viewing the commit's comment from Phabricator.

First step
Go to the configuration interface at <your-hosted-phabricator>/config/all/.
Second step
Edit the following two parameters:
In bugtraq.logregex set:
/[Ii]ssues?:?(\s*,?\s*\d+)+/
/(\d+)/
In bugtraq.url set:
https://<your-issue-tracker>/issue/%BUGID%
If you are using these same config settings for another tracking system, you will have to pick and choose. But, we found this very useful when linking to an unsupported bug tracking system.
You should be able to replace the url to your local system's url and build your own regex that will match your "Issue: XXXX" commit message.
Good Luck!

Related

Can't Send Email from Mobius form

I'm trying to create a simple form, but not getting very far.
I deleted all the extensions etc and then reinstalled so I just had the basic setup.
I select a Contact Form, and updated the owner email. Yet it gave me an error saying sender address not specified.
Any help would be appreciated.
Screenshot 1 at https://www.screencast.com/t/PgpsPn0P8mrb
Screenshot 2 at https://www.screencast.com/t/G9cKnRN2
I couldn't find any log entries for the sending. In the DNN logs there were lots of errors with HttpClient not found from MailChimps.cs, but I'm not wanting to use MailChimp. In my previous attempt I tried removing mailchimp references from the code and still got these errors.
I like the concept, but I find the help very unhelpful, often out of date and it assumes way to much. I'm willing to persist, but I'm under time contrainsts and it may be just easier to build my own module in C#.
You can set this globally, or on each form in the normal form configuration:

Download a file from a permalink URL, and not a direct exe url

So I am using InnoSetup 6 which natively supports downloading files from the internet during installation. I have figured out downloading files given a direct link, from this thread Inno Setup: Install file from Internet
However, I can't for the life of me figure out how to download the latest version of a file given a permalink URL. My specific example is to download the Microsoft Hosting package.
https://dotnet.microsoft.com/permalink/dotnetcore-current-windows-runtime-bundle-installer
Going to this page automatically downloads the latest package.
Inno doesn't like this link (or I don't know how to get Inno to use it) since it doesn't point to the direct file. If I use the direct link (https://download.visualstudio.microsoft.com/download/pr/24847c36-9f3a-40c1-8e3f-4389d954086d/0e8ae4f4a8e604a6575702819334d703/dotnet-hosting-5.0.6-win.exe) this works for obvious reasons.
I'd like to always download the latest, but I'm not sure how to accomplish this. Any suggestions?
Adding super basic code being used...
DownloadPage.Clear;
DownloadPage.Add('https://dotnet.microsoft.com/permalink/dotnetcore-current-windows-runtime-bundle-installer', 'dotnet-hosting.exe', '');
DownloadPage.Show;
You would have to retrieve the HTML page, find the URL in the HTML code and use it in your download code.
See Inno Setup - HTTP request - Get www/web content
It would be quite unreliable. Microsoft can change the HTML any time.
You better setup your own webpage (web service) that will provide an up to date link to your installer. The web page can even do what I suggested: retrieve the URL from the Microsoft's download page. In case Microsoft changes the HTML, you can fix your web page any time. What you cannot do with the installer.
Without realizing it you are asking two different question here. That is because these "permalinks" aren't really permalinks but redirects to some dynamic resource that has a link to what you are looking for.
So first, addressing the Microsoft "permalink", you need to realize that under the hood you are accessing a URL that redirects to some page which will point to the latest. Then under the hood, that page invokes a JavaScript function, IF YOU ACCESSING VIA A WEB BROWSER, to download the installer. Note that both the page pointed to and the code to invoke the installer WILL eventually change. In fact, the code itself logs a "warning" when people attempt to download directly:
If you do a view source you'll see:
<script>
$(function () {
recordDownload('.NET', 'runtime-aspnetcore-5.0.6-windows-hosting-bundle-installer');
window.open("https://download.visualstudio.microsoft.com/download/pr/24847c36-9f3a-40c1-8e3f-4389d954086d/0e8ae4f4a8e604a6575702819334d703/dotnet-hosting-5.0.6-win.exe", "_self");
});
function recordManualDownload() {
ga("send", "event", "Download.Warning", "Direct Link Used", "runtime-aspnetcore-5.0.6-windows-hosting-bundle-installer");
}
</script>
So you can download the HTML from this page and use some regex to get the directo downloadlink but beware, the link is going to change every time Microsoft releases a new version. Furthermore, WHEN (not if but when) MS decides to rebrand this entire process might break. So the best you can do here is try to download the html and try parse the download URL from this "permalink"
As an alternative. you can to download the latest DotNet powershell install script as described here.
If possible, execute that script directly. If not look at the function Get-AkaMSDownloadLink within the install script to see how it builds the url to get the latest version. You would probably be better served using that building and using that URL as opposed to attempting to download from some arbitrary HTML code.
Now, onto the second question you might not have realized your were asking is how to automate this for any random installer. The answer is you can't. Some might have a permalink that directly points to the latest but you are always going to find cases like Microsoft. Best you can down is hard code some links in some service, as #martin-prikryl suggested, and when the break update the links in those services.

Download/Upload of Page Remarkup in Phabricator Wiki (Phriction)

The company I work for uses the "Phriction" wiki in Phabricator for a considerable amount of documentation. I'd like to be able do the following, programmatically, in order of importance:
Download (e.g., with curl or wget) the ReStructuredTExt (RST) to a local file where I can edit it, diff it, etc. Ideally I should be able to download either the latest version or any specific version.
Locally render (e.g., in a local graphical web browser) the markup as Phabricator would render it. If relative links can link correctly back to the original wiki, that's a bonus.
Upload new versions of the wiki page.
If you have don't know how to do exactly any of this, but have information or tool suggestions that would help me get started on writing software to do the above, please mention them. (If you're worried about too many answers that don't actually answer any of the questions above, try adding or editing a single community answer for this sort of information.)
I would do the following in your situation:
Downloading the single phriction pages using the API (Conduit) methods in the phriction section.
Therefore you need a Conduit Api Token. You can create in your profile settings of your phabricators intstance.
Then take a look at the phriction.info mehtod: This methods needs the page slug as parameter. In this example I use the /changelog/ page.
You can choose between arcanist, cURl or PHP to use the RestApi. Additionally you can use any other way to preform RestApi commands in the cURL syntax.
If you need some more examples how to run the conduit method you can toggle between some variations at the bottom of the output page.
Transform the page content as you like.
Upload the page again with the conduit methods (phriction.edit).
The way you downloaded the content you can edit the documents, too. But here you need some more parameter:
I personally, try first all conduit methods via the web interface first and then transform it to an a script.

How to get nexus project specific permissions running with repository targets?

I would like to set up our long running nexus (currently updated to 2.10) for project specific permissions, so that users are limited to access only a part of the repository.
I found this article and this one which exactly match what I am looking for.
So I set up our config like this.
The regexp for us is: ./de/mycompany/myproject./.*
But there is still one error:
I can log in with restricted view and in the search I just see the filtered artifacts. Which is great. But the bottom part of the UI where the repository tree is shown, is empty. Instead I get a 403 error. Looking in the system feed for authentication I find:
Unable to authorize user [myuser] for read(HTTP method "GET") to /nexus/service/local/repositories/releases/index_content/ from IP Address 192.168.0.41, user agent:"n/a"
"releases" is the name of our repo, for a part of which the user is permitted. So what to do to get access to this strange index_content? Do I need another privilege or role? Or another regexp? Using ./index_content/. does not work.
Well, as nobody knew a solution a did a lot of try an error at the weekend. Finally I ended with added a second regex just with a slash ("/"). Now it works as expected and documented in the referred articles.
Right, you need to add permissions for the directories along the path for "browse storage" to work.
See here for more information: https://support.sonatype.com/entries/21592111

Umbraco url's displaying home node in one node, sometimes

So I have an umbraco setup with a 'content' root node and then a 'home' node under that. Under the 'home' node is the content and the URLs are the name of those nodes for example I have a 'about u's node under home and it's URL is '/about-us/'
In the case of the 'news' node, below 'about us', its children some times get '/home/about-us/news/title' of the story as the URL, which throws a 404. I can see that this is the URL of the node on the properties tab, but if I republish it it returns to '/about-us/news/title' for a period before returning to the broken link.
I have only seen this behavior on this node, which contains new-item document types. I basically watched the umbraco tv video and created it following along.
It seems to be to be a umbraco bug, but I would really appreciate any help with the issue
In the web.config, there is a setting called umbracoHideTopLevelNodeFromPath. This causes the behavior you are describing when it is set to false. Do you perhaps have multiple people working on the site and publishing different versions of the web.config that have this setting changed?
When publishing a node with the setting set to false, it would add the /home part to the URL. Otherwise, it would leave off the /home.
Once the Umbraco application has started, there are several processes that run on a regular basis (e.g. to check for expired content). It is possible to piggy-back on these by creating a custom class that inherits from umbraco.cms.businesslogic.ApplicationBase. If you have created one that uses the Document.AfterPublish eventhandler then I would check that it is not causing the issue.
I'm assuming that you haven't written one of these though, so the only other thing I can suggest is checking whether it is an installed package that is causing the issue. Have you installed any Umbraco packages? If so, do they have any automated behaviours, like creating folders etc. If so, this may be causing the issue. The author of a package will usually have a website, codeplex project etc. and they will usually have a issue list or blog.
Edit
I've just quickly checked and uBlogsy, one of the plugins you mention exactly this. It has auto moving and sorting of posts. This is described in the release notes. If you are using this tool for creating news pages, then this will be your issue.
I followed obsidian's link in his answer and read about someone else having the same issue. It seems to be traces back to a umbraco.library:NiceUrlFullPath call in the RSS creator that was feeding news items. I replaced the umbraco.library:NiceUrlFullPath calls with umbraco.library:NiceUrl calls and the issue has disappeared.

Resources