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

Project versioned settings log constant comment "no comments" #164

Closed
ghost opened this issue Sep 1, 2020 · 22 comments
Closed

Project versioned settings log constant comment "no comments" #164

ghost opened this issue Sep 1, 2020 · 22 comments
Labels
available in alpha or beta release item is released in a "pre-release" version ready for testing. enhancement waiting for release
Milestone

Comments

@ghost
Copy link

ghost commented Sep 1, 2020

Expected Behavior

Git log of TeamCity project configuration versioned settings has clarifications of what was changed.

Current Behavior

Any changes of configuration of TeamCity webhooks are logged as "no comments" (compare to messages below on changes of other TeamCity areas):
Screen Shot 2020-09-01 at 11 45 10

Steps to Reproduce (for bugs)

  1. Go to Administration -> Root Project -> Versioned Settings ( http://1.2.3.4:8111/admin/editProject.html?projectId=_Root&tab=versionedSettings )
  2. Enable synchronization with remote git repo
    Screen Shot 2020-09-01 at 11 52 44
  3. make changes in WebHook configuration
  4. open git log of the TeamCity changes and compare webhooks-related changes vs other changes

Your Environment

  • tcWebHooks Version: 1.1.362.398
  • TeamCity Version: 2020.1.3
  • TeamCity server Operating System: ubuntu
  • Are you using a WebHook Template?: not applicable

Example Configuration (xml)

@netwolfuk
Copy link
Member

Hi @schernov-xo. I'll have a look too see if there is a way I can pass a comment when I persist the hook. That code predates any of the settings stuff. I'm using the method of storing settings which is compatible with TC9 and below.

I'll take a later in the week when I'm back from vacation. No internet here and not computer! 😁

@netwolfuk
Copy link
Member

Hi @schernov-xo I had a look a the code, and I can't see how the comment could be set using the plugin-settings.xml storage method. I have asked a question here: https://youtrack.jetbrains.com/issue/TW-67532, however I don't know if it's going to be possible.

@netwolfuk
Copy link
Member

Anton from Jetbrains has replied and shown me how to do this. I'm embarrassed to say I was looking at the wrong code, but he found it.

I'll refactor that code this week and get it out as part of 1.2.0 alpha7. I see you're using 1.1, so I'll back port it and do a 1.1 release as well. Hopefully this week or over the weekend.

Thanks for raising this issue. I'm happy to make tcWebHooks better!

@ghost
Copy link
Author

ghost commented Sep 8, 2020

Perfect, thanks!

@netwolfuk
Copy link
Member

Hi @schernov-xo

I have the comments now working. I've not setup a synchronised project yet, but I can see comments appearing in the project audit log. Do you think the comments are right? Should I have more description?

image

This is on 1.2.0 alpha7 which will be released this weekend. I'll check the code on 1.1.x.x and see how different it is.

@netwolfuk netwolfuk added this to the v1.2 milestone Sep 11, 2020
@netwolfuk
Copy link
Member

Looking at the 1.1 code, the infrastructure to shift the logic to does not exist. I'll hack it in, considering 1.1 will be old in a few months when 1.2 is finished.

@ghost
Copy link
Author

ghost commented Sep 12, 2020

Thanks. Will check it this weekend

@ghost
Copy link
Author

ghost commented Sep 13, 2020

The issue is still here. I've built the plugin from the latest master (eb7bafd1) via mvn clean install -DskipTests.
Screen Shot 2020-09-13 at 21 46 38
Setting changed: add trigger event
Screen Shot 2020-09-13 at 21 50 09
The commit message is the same
Screen Shot 2020-09-13 at 21 45 31

@netwolfuk
Copy link
Member

Eeek. I haven't pushed. Sorry. Had a sick kid all weekend.

@netwolfuk
Copy link
Member

@netwolfuk
Copy link
Member

I have some further tidy up to do in the controller, but this works, and you can test that the messages you get are useful.

Btw. Master is the 1.2.0 branch, so you're now running 1.2.0 alpha 7.

@ghost
Copy link
Author

ghost commented Sep 13, 2020

Now comments are fine. Only one thing - the new version of the plugin does not support legacy configuration format (migration), the webhooks should be recreated:
Screen Shot 2020-09-13 at 22 16 53
Not a big deal for me, but in some cases it may be a problem.

P.S. thanks!!

@netwolfuk
Copy link
Member

Oh! They definitely should be being migrated. I wonder why that happened. Could you share an old copy of your plugin-settings.xml file (with the URL or anything else sensitive removed)?

@ghost
Copy link
Author

ghost commented Sep 13, 2020

Sure. Note: it's not a Root project, it's a project with parent=root

<?xml version="1.0" encoding="UTF-8"?>
<settings>
  <webhooks enabled="true">
    <webhook url="https://rest-api-team-XYZ" enabled="true" format="json" template="none">
      <states>
        <state type="buildFixed" enabled="false" />
        <state type="changesLoaded" enabled="false" />
        <state type="responsibilityChanged" enabled="false" />
        <state type="buildFinished" enabled="true" />
        <state type="buildStarted" enabled="true" />
        <state type="buildFailed" enabled="true" />
        <state type="beforeBuildFinish" enabled="false" />
        <state type="buildSuccessful" enabled="true" />
        <state type="buildBroken" enabled="false" />
        <state type="buildInterrupted" enabled="true" />
      </states>
      <build-types enabled-for-all="false" enabled-for-subprojects="false">
        <build-type id="bt23" />
      </build-types>
    </webhook>
  </webhooks>
</settings>

@netwolfuk
Copy link
Member

Since you're saving all your changes into git, do you have a version of the plugin settings with the webhooks removed after the upgrade?

I'm trying to figure out if they were migrated and then removed, or migrated and then disappeared on edit. Or maybe some other event occurred and code did not handle the event correctly.

You should be able to tell when the file was migrated. It will have added the queue event configuration, and removed the payload format XML attribute.

@netwolfuk
Copy link
Member

Thanks for the XML file. It's a legacy JSON webhook. I'm sure all that code is unit tested. I wonder if it's a combination of the migration and the settings in git. Time for be to setup that git stuff. Sorry about all this.

@ghost
Copy link
Author

ghost commented Sep 13, 2020

Welcome. Glad to help.

@netwolfuk
Copy link
Member

netwolfuk commented Sep 13, 2020

Interesting: Your screenshot of the XML changes show that the webhook was migrated. I can see events for queued, etc.
It looks like you were able edit the webhook then. Was it only after the tcWebhooks version from the issue-164 branch was installed that the webhook disappeared?

@netwolfuk
Copy link
Member

Created bug #167

@ghost
Copy link
Author

ghost commented Sep 14, 2020

The problem here to clarify what happened is there was an intermediate version (latest master).
But when latest master was installed, the old hook was on it's place.
Then I installed from the bugfix branch and webhook disappeared.

@netwolfuk
Copy link
Member

Thanks for the clarification. I'm also running the latest branch for this issue, and previously was running a build off the branch that is now master. Except I have been running 1.2 for about 6 months, so it could be an issue with the upgrade.

My hunch is that it's related to the settings in git. I'll need to set that up and test it, but that could be a day or two away.

@netwolfuk
Copy link
Member

Because there is nothing I can do at this time to solve #167, I'll merge this branch in and get alpha 7 released this weekend.

@netwolfuk netwolfuk added the available in alpha or beta release item is released in a "pre-release" version ready for testing. label Sep 20, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
available in alpha or beta release item is released in a "pre-release" version ready for testing. enhancement waiting for release
Projects
None yet
Development

No branches or pull requests

1 participant