Unable to find xmpp.hrl and ejabberd.hrl in ejabberd-19.02 - ejabberd

I am new with Ejabberd and Erlang and I am trying to add this module. I made the changes like I replace the jlib.hrl with xmpp.hrl and replace the packet by the message as suggested in this answer my issue is whenever I am trying to compile it say xmpp.hrl and ejabberd.hrl is not found how can I solve this issue.
I want to send the FCM notification to the offline user if some trying to send a message to him. am I doing right? or there have some other best ways to achieve this

ejabberd.hrl was removed a year ago: https://github.com/processone/ejabberd/commit/fd8e07af4789be362a61755ea47f216baeb64989
Download ejabberd source code, copy mod_offline_post.erl to the src/ dir, and make your changes, including those two:
diff --git a/src/mod_offline_post.erl b/src/mod_offline_post.erl
index 312278dc0..f4e6f79a1 100644
--- a/src/mod_offline_post.erl
+++ b/src/mod_offline_post.erl
## -13,8 +13,7 ##
-define(PROCNAME, ?MODULE).
--include("ejabberd.hrl").
--include("jlib.hrl").
+-include("xmpp.hrl").
-include("logger.hrl").
-include("mod_muc_room.hrl").
Then compile and install ejabberd.

Related

BigCommerce stencil bundle theme validating issues in schema.json file

Hello developers out here!
I struggle with stencil bundle and stencil push issues.
I get error at "Validating theme..."
Error: Your theme's schema.json has errors:
schema[1].settings[28].options[0].value should be string,number
schema[1].settings[28].options[1].value should be string,number
...
It seems that I get this issue after try to test latest cornerstone (5.4.5) theme version, and update stencil-cli and now I can't use oldest version (1.10.0) schema.json file -> https://github.com/bigcommerce/cornerstone/blob/1.10.0/schema.json
Now it only works with these two files:
schema.json -> https://github.com/bigcommerce/cornerstone/blob/4.5.4/schema.json
schemaTranslations.json -> https://github.com/bigcommerce/cornerstone/blob/4.5.4/schemaTranslations.json
But I am not sure how it would impact live site work if I use different schema files.
It is possible to work again with old schema.json file?
Previously all worked...
I tried to:
delete all node_modules
reinstall #bigcommerce/stencil-cli
and node modules (npm install)
These look similar to errors when the schema.json or schemaTranslations.json file have been removed or modified, could you add any relevant schema code in your post? Since Stencil CLI 2.0, part of the bundle process now validates a schemaTranlsations.json file which has been included since Cornerstone 4.5.4. This change can be found on the GitHub repo here as well as on our DevCenter Changelog.
Hello #dakterits and #kyle-obrien
The error which you mentioned means that option number 0 and 1 in setting number 28 in the schema file has either empty value or different value. So, to fix this issue, you don't have downgrade the node or reinstall stencil or delete any file.
The Solution:
Download the original copy of the theme.
Edit the original theme schema file.
If you have any file compare software then compare edited theme schema with original theme schema.
Once you compare, you will definitely see any change in value in defined settings.

Gerrit review not found in spite of present in DB

We are using Gerrit 2.12 with MySQL DB. There is one review open for a while but when I try to access it from Gerrit UI, I get following error.
The page you requested was not found, or you do not have permission to view this page.
I am logged into the UI and my account have administrative capabilities.I can see the entry of the change in changes table in data base. Should reindexing solve the problem? I am more curious about what was the trigger for disappearance of change in UI.
I had the same problem. I have verified if the changes were there in the repository by cloning the corresponding change under refs/changes branch.
As the documentation says, When a commit is pushed for review, Gerrit stores it in a staging area which is a branch in the special refs/changes/ namespace. A change ref has the format refs/changes/XX/YYYY/ZZ where YYYY is the numeric change number, ZZ is the patch set number and XX is the last two digits of the numeric change number, e.g. refs/changes/20/884120/1. Understanding the format of this ref is not required for working with Gerrit.
Using the change ref, git clients can fetch the corresponding commit, e.g. for local verification.
git clone <URL>
cd <reponame>
git fetch https://yourhostname/reponame refs/changes/16/261016/1 && git checkout FETCH_HEAD
If you find the fetch to be happening successful, it means that the change is present and therefore a full reindex as the appropriate user should fix.
su gerrit -c "java -jar gerrit.war reindex"
PS. Online reindex did not help in my case. I had to do a full offline reindex as above.

Mercurial API: How can I get the coming content of the file which was pulled but has not been updated yet?

I'm a complete noob at Mercurial API and Python, but I'm trying to write a useful extension for myself and my colleagues now.
Let's assume I have a repository which contains some code and an auxiliary file .hgdata. The code and .hgdata are both under Mercurial's control. When I execute a command pull-extended which is provided by my extension, I want it to make a pull and then to analyze the state of a .hgdata and probably make some additional actions. The problem is that when my command is invoked, it just pulls the incoming changesets, but it can't look into the actual .hgdata without making a preceding repository update. Is there any way to watch the after update .hgdata besides repository update?
I've received an answer on the Mercurial's official IRC channel:
In order to get an actual file state after making a pull, we may use repo[revision][file].data().
P.S. I haven't checked that yet. If it works, I will close the question.

Run build on change but don't checkout in Hudson

I have kind of an interesting problem...
So I'm trying to run a build every time I see a change on a directory in my SCM in Hudson. However, I don't need to pull the directory to run my script. Is there any way to check if there's a change in a directory, but don't pull it?
In addition, there is another directory which I do need to pull from Hudson at the same time. So basically I want something like:
On change of directory A or B:
pull directory B only
run script
I was told there was functionality like this in Hudson, but I can't find it. Any suggestions? Thanks for the help!
In case anyone is interested, I was able to accomplish this with just Hudson and Perforce.
When using Perforce as the SCM (don't know about the others) there is a 'Use View Mask' checkbox. Checking that give you the ability to choose which directories/files in Perforce to poll without actually pulling those files. For example, I had in my view:
//depot/my_script
I didn't want my script to run automatically when I had a new version, so I put it int o the "Poll Exclude File(s) text box:
//depot/my_script
Which pulls the latest version of my script. Then I checked the Use View Mask checkbox and put:
//depot/my_code_to_compile/
into the View Mask box.
To make Perforce poll for changes, I just checked the "Poll SCM" in build triggers and then made it check every minute. (by inserting "* * * * *" into the Scheduler box)
So to sum up, with the variables set as above, my Hudson job had the following behavior:
check for changes every minute
On changes to //depot/my_code_to_compile/, the Hudson job will run
On changes to //depot/my_script, nothing will happen
The job will pull changes to my_script, but will download nothing from //depot/my_code_to_compile/.
I think you need to install the FSTrigger Plugin for this functionality. To what the wiki pages show this is supported in Jenkins, I am not sure about Hudson compatibility.

Configure or Create hudson job automatically

Is there any way to create new Hudson job by one more Hudson job based one previous Jobs?
For example if I need to create new bunch of jobs one by one, Automatically create 4 jobs with similar configuration with different parameter
Basically steps like this
create SVN branch I can call svn cp command and make it parametrized using script
Create some build based on new svnbranch name
Later tag it
Or other word, I need to clone the previous job and give the new branch name where ever $ Branch comes in new job.
Thanks
You can try the Hudson Remote API for this kind of task (setting up an Hudson project).
See this tutorial for instance, and remember you can display the help quite easily:
java -jar hudson-cli.jar -s http://your_Hudson_server/ help
So, to copy a job:
java -jar hudson-cli.jar -s http://your_Hudson_server/ copy-job myjob copy-myjob
You could use groovy system script like this :
def jenkins = hudson.model.Hudson.instance
def template = jenkins.getItem("MyTemplate")
def job = jenkins.copy(template,"MyNewJob")
job.scm = new hudson.scm.SubversionSCM("http://base/branches/mybranche")
job.save()
Kind of already covered in the other answers, but for an easy way to copy the config.xml over:
curl --user USER:PASS -H "Content-Type: text/xml" -s
--data-binary "#config.xml" "http://hudsonserver:8080/createItem?name=newjobname"
There seems to be a plugin for jenkins.
https://wiki.jenkins-ci.org/display/JENKINS/Job+DSL+Plugin
I have not tested the plug-in yet. But if the plugin works, it should alleviate some of human errors from straight copying a job and modifying variables/values.
def jenkins = hudson.model.Hudson.instance
def template = jenkins.getItem("MyTemplate")
def job = jenkins.copy(template,"MyNewJob")
job.save()
I used this now I have to change the parameter values of MyNewJob using Groovy how will I do that?
ex I have a parameter called "Build_BranchName" and the default is //perforce/mybranch
I have to change it to
//perforce/mynewbranch
You have the option that VonC just gave you (which is probably the safest way but you can also go a different rout by just creating a new directory in {Hudson_Home}\jobs (the directory name will be the job name) and copy a modified config.xml in there. The modification will basically just be the SVN URL. You should check out the xml from the job that you are copying. You need to find out how you change the xml file via script, but this is a secondary problem.
Unfortunately, you have to either restart Hudson, or force a reload of the configuration. (visit the page http://:/reload to reload the config).
In case you're willing to use GIT (like I do, mirroring the main SVN repo, onto the Hudson/Jenkins server, and it works great)....
..you could try Stephen Haberman's post-receive-hudson:
This hook creates new jobs for each
branch in the Hudson continuous
integration tool. Besides creating the
job if needed, the user who pushed is
added to the job's email list if they
were not already there.
In any case, that script can give you new hints on how to remote control Jenkins(Hudson).